diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/broker/DefaultSubscriptionRegistry.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/broker/DefaultSubscriptionRegistry.java index 48a42b2196..140ad83f71 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/broker/DefaultSubscriptionRegistry.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/broker/DefaultSubscriptionRegistry.java @@ -497,6 +497,23 @@ public class DefaultSubscriptionRegistry extends AbstractSubscriptionRegistry { return this.selectorExpression; } + @Override + public boolean equals(Object other) { + if (this == other) { + return true; + } + if (other == null || getClass() != other.getClass()) { + return false; + } + return getId().equals(((Subscription) other).getId()); + + } + + @Override + public int hashCode() { + return getId().hashCode(); + } + @Override public String toString() { return "subscription(id=" + this.id + ")";