Match subscriptions to remove by id
Commit 524ca1a676 unintentionally changed
how subscriptions to be removed are matched. This commit restores that.
See gh-25298
This commit is contained in:
parent
471577a11b
commit
f9ba58eab9
|
|
@ -341,12 +341,13 @@ public class DefaultSubscriptionRegistry extends AbstractSubscriptionRegistry {
|
|||
|
||||
public void updateAfterRemovedSubscription(String sessionId, Subscription subscription) {
|
||||
if (subscription.isPattern()) {
|
||||
String patternDestination = subscription.getDestination();
|
||||
for (String destination : this.destinationCache.keySet()) {
|
||||
if (pathMatcher.match(patternDestination, destination)) {
|
||||
removeInternal(destination, sessionId, subscription.getId());
|
||||
String subscriptionId = subscription.getId();
|
||||
this.destinationCache.forEach((destination, sessionIdToSubscriptionIds) -> {
|
||||
List<String> subscriptionIds = sessionIdToSubscriptionIds.get(sessionId);
|
||||
if (subscriptionIds != null && subscriptionIds.contains(subscriptionId)) {
|
||||
removeInternal(destination, sessionId, subscriptionId);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
removeInternal(subscription.getDestination(), sessionId, subscription.getId());
|
||||
|
|
|
|||
Loading…
Reference in New Issue