Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
spring-projects-issues opened this issue May 14, 2017 · 1 comment
Assignees
Labels
in: messaging Issues in messaging modules (jms, messaging) type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented May 14, 2017

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

@spring-projects-issues
Copy link
Collaborator Author

Rossen Stoyanchev commented

Thanks for finding this and identifying the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: messaging Issues in messaging modules (jms, messaging) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants