Browse Source

Fix duplicate STOMP subscription id issue

Issue: SPR-15543
pull/1422/merge
Bao Tran 8 years ago committed by Rossen Stoyanchev
parent
commit
44c31a6aad
  1. 7
      spring-messaging/src/main/java/org/springframework/messaging/simp/broker/DefaultSubscriptionRegistry.java

7
spring-messaging/src/main/java/org/springframework/messaging/simp/broker/DefaultSubscriptionRegistry.java

@ -292,8 +292,11 @@ public class DefaultSubscriptionRegistry extends AbstractSubscriptionRegistry { @@ -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());
}
}
}
}

Loading…
Cancel
Save