mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Allow JS to work over leafnodes for streams
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -1176,7 +1176,8 @@ func (c *client) updateSmap(sub *subscription, delta int32) {
|
||||
|
||||
// If we are solicited make sure this is a local client or a non-solicited leaf node
|
||||
skind := sub.client.kind
|
||||
if c.isSpokeLeafNode() && !(skind == CLIENT || skind == SYSTEM || (skind == LEAF && !sub.client.isSpokeLeafNode())) {
|
||||
|
||||
if c.isSpokeLeafNode() && !(skind == CLIENT || skind == SYSTEM || skind == JETSTREAM || (skind == LEAF && !sub.client.isSpokeLeafNode())) {
|
||||
c.mu.Unlock()
|
||||
return
|
||||
}
|
||||
|
||||
@@ -255,10 +255,6 @@ func (mset *Stream) subscribeToStream() error {
|
||||
|
||||
// FIXME(dlc) - This only works in single server mode for the moment. Need to fix as we expand to clusters.
|
||||
func (mset *Stream) subscribeInternal(subject string, cb msgHandler) (*subscription, error) {
|
||||
return mset.nmsSubscribeInternal(subject, false, cb)
|
||||
}
|
||||
|
||||
func (mset *Stream) nmsSubscribeInternal(subject string, internalOnly bool, cb msgHandler) (*subscription, error) {
|
||||
c := mset.client
|
||||
if c == nil {
|
||||
return nil, fmt.Errorf("invalid stream")
|
||||
@@ -273,7 +269,7 @@ func (mset *Stream) nmsSubscribeInternal(subject string, internalOnly bool, cb m
|
||||
mset.sid++
|
||||
|
||||
// Now create the subscription
|
||||
sub, err := c.processSub([]byte(subject+" "+strconv.Itoa(mset.sid)), internalOnly)
|
||||
sub, err := c.processSub([]byte(subject+" "+strconv.Itoa(mset.sid)), false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user