Fix duplicate STOMP subscription id issue

Issue: SPR-15543
This commit is contained in:
Bao Tran 2017-05-14 18:55:53 +03:00 committed by Rossen Stoyanchev
parent 81143a80c4
commit 4fc41eeeb9
1 changed files with 5 additions and 2 deletions

View File

@ -292,8 +292,11 @@ public class DefaultSubscriptionRegistry extends AbstractSubscriptionRegistry {
String cachedDestination = entry.getKey();
if (getPathMatcher().match(destination, cachedDestination)) {
LinkedMultiValueMap<String, String> subs = entry.getValue();
subs.add(sessionId, subsId);
this.accessCache.put(cachedDestination, subs.deepCopy());
// Subscription id's may also be populated via getSubscriptions()
if (!subs.containsKey(sessionId) || !subs.get(sessionId).contains(subsId)) {
subs.add(sessionId, subsId);
this.accessCache.put(cachedDestination, subs.deepCopy());
}
}
}
}