Skip to content

DefaultSubscriptionRegistry should prevent duplicate subscription id in accessCache [SPR-15543] #20102

Closed
@spring-projects-issues

Description

@spring-projects-issues

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:

Referenced from: pull request #1427, and commits 4fc41ee, b6e2524, 44c31a6, 8deec95

Metadata

Metadata

Assignees

Labels

in: messagingIssues in messaging modules (jms, messaging)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions