Merge branch '6.1.x'
This commit is contained in:
commit
aa05a6a3b3
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -305,6 +305,9 @@ public class DefaultSubscriptionRegistry extends AbstractSubscriptionRegistry {
|
|||
return Collections.singletonList(subscriptionId);
|
||||
}
|
||||
else {
|
||||
if (subscriptionIds.contains(subscriptionId)) {
|
||||
return subscriptionIds;
|
||||
}
|
||||
List<String> result = new ArrayList<>(subscriptionIds.size() + 1);
|
||||
result.addAll(subscriptionIds);
|
||||
result.add(subscriptionId);
|
||||
|
|
|
|||
|
|
@ -102,6 +102,16 @@ class DefaultSubscriptionRegistryTests {
|
|||
MultiValueMap<String, String> actual = this.registry.findSubscriptions(createMessage(dest));
|
||||
assertThat(actual).hasSize(1);
|
||||
assertThat(actual.get(sessId)).containsExactly(subId);
|
||||
|
||||
// Register more after destinationCache populated through findSubscriptions,
|
||||
// and make sure it's still only one subscriptionId
|
||||
|
||||
this.registry.registerSubscription(subscribeMessage(sessId, subId, dest));
|
||||
this.registry.registerSubscription(subscribeMessage(sessId, subId, dest));
|
||||
|
||||
actual = this.registry.findSubscriptions(createMessage(dest));
|
||||
assertThat(actual).hasSize(1);
|
||||
assertThat(actual.get(sessId)).containsExactly(subId);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
Loading…
Reference in New Issue