Skip to content

Commit 7e8333a

Browse files
committed
subscription messages can also be filtered out because the sub is already registered internally and will be re-subscribed automatically after a recconnect. It's only a rare edge case anyway
1 parent 235bbd7 commit 7e8333a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/java/io/nats/client/impl/NatsConnection.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,8 +1107,11 @@ void sendSubscriptionMessage(String sid, String subject, String queueName, boole
11071107
}
11081108
bab.append(SP).append(sid);
11091109

1110-
ProtocolMessage subMsg = new ProtocolMessage(bab, false);
1111-
1110+
// setting this to filter on stop.
1111+
// if it's an "internal" message, it won't be filtered
1112+
// if it's a normal message, the subscription will already be registered
1113+
// and therefore will be re-subscribed after a stop anyway
1114+
ProtocolMessage subMsg = new ProtocolMessage(bab, true);
11121115
if (treatAsInternal) {
11131116
queueInternalOutgoing(subMsg);
11141117
} else {

0 commit comments

Comments
 (0)