Closed
Description
Bao Tran opened SPR-15543 and commented
In DefaultSubscriptionRegistry, multiple subscriptions on the same session should have unique subscription id's.
In DefaultSubscriptionRegistry.addSubscriptionInternal method, there are calls to:
this.subscriptionRegistry.addSubscription(sessionId, subsId, destination, expression);
this.destinationCache.updateAfterNewSubscription(destination, sessionId, subsId);
- Assume that registerSubscription is called with a message argument.
- If findSubscriptions method is called with destination argument after addSubscription and before updateAfterNewSubscription, accessCache will contain duplicate subscriptionId for destination - sessionId key.
- This will lead to a subscriber receives a message twice due to loop in SimpleBrokerMessageHandler.sendMessageToSubscribers
Affects: 4.3.8
Issue Links:
- Cannot receive message sometimes with SimpleBrokerMessageHandler [SPR-15282] #19848 Cannot receive message sometimes with SimpleBrokerMessageHandler
Referenced from: pull request #1427, and commits 4fc41ee, b6e2524, 44c31a6, 8deec95