From abb8a93e2fa3e91286d72518dbb5f88c219834ef Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Fri, 3 Jan 2014 15:50:24 -0500 Subject: [PATCH] Drop separate user dest property for subscriptions Before this change DefaultUserDestinationResolver provided a separate destination prefix property for identifying "user" destinations in subscription requests as opposed to in sent messages. Such a separate property should not be needed. Issue: SPR-11263 --- .../simp/user/DefaultUserDestinationResolver.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/user/DefaultUserDestinationResolver.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/user/DefaultUserDestinationResolver.java index 8d3bec59dc..fc3d1b44f3 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/user/DefaultUserDestinationResolver.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/user/DefaultUserDestinationResolver.java @@ -48,8 +48,6 @@ public class DefaultUserDestinationResolver implements UserDestinationResolver { private String destinationPrefix = "/user/"; - private String subscriptionDestinationPrefix = "/user/queue/"; - /** * Create an instance that will access user session id information through @@ -70,7 +68,6 @@ public class DefaultUserDestinationResolver implements UserDestinationResolver { public void setUserDestinationPrefix(String prefix) { Assert.hasText(prefix, "prefix must not be empty"); this.destinationPrefix = prefix.endsWith("/") ? prefix : prefix + "/"; - this.subscriptionDestinationPrefix = this.destinationPrefix + "queue/"; } /** @@ -82,13 +79,6 @@ public class DefaultUserDestinationResolver implements UserDestinationResolver { return this.destinationPrefix; } - /** - * Return the prefix used to identify user destinations for (un)subscribe messages. - *

By default "/user/queue/". - */ - public String getSubscriptionDestinationPrefix() { - return this.subscriptionDestinationPrefix; - } /** * Return the configured {@link UserSessionRegistry}. @@ -130,7 +120,7 @@ public class DefaultUserDestinationResolver implements UserDestinationResolver { SimpMessageType messageType = headers.getMessageType(); if (SimpMessageType.SUBSCRIBE.equals(messageType) || SimpMessageType.UNSUBSCRIBE.equals(messageType)) { - if (!checkDestination(destination, this.subscriptionDestinationPrefix)) { + if (!checkDestination(destination, this.destinationPrefix)) { return null; } if (user == null) {