Updates based on comments

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
Ivan Kozlovic
2019-04-22 12:38:20 -06:00
parent bb4e8ae0f9
commit 41436fb787
4 changed files with 35 additions and 27 deletions

View File

@@ -1232,16 +1232,16 @@ func (c *client) processInboundLeafMsg(msg []byte) {
// Check for no interest, short circuit if so.
// This is the fanout scale.
if len(r.psubs)+len(r.qsubs) > 0 {
var collect bool
flag := 0
// If we have queue subs in this cluster, then if we run in gateway
// mode and the remote gateways have queue subs, then we need to
// collect the queue groups this message was sent to so that we
// exclude them when sending to gateways.
if len(r.qsubs) > 0 && c.srv.gateway.enabled &&
atomic.LoadInt64(&c.srv.gateway.totalQSubs) > 0 {
collect = true
flag = collectQueueNames
}
qnames = c.processMsgResults(acc, r, msg, c.pa.subject, c.pa.reply, collect, false)
qnames = c.processMsgResultsEx(acc, r, msg, c.pa.subject, c.pa.reply, flag)
}
// Now deal with gateways