Allow JS to work over leafnodes for streams

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2020-02-06 15:51:16 -08:00
parent da5425b3da
commit 685efc36df
2 changed files with 3 additions and 6 deletions

View File

@@ -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
}

View File

@@ -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
}