[hornetq-commits] JBoss hornetq SVN: r11728 - branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/stomp.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Nov 21 10:00:10 EST 2011


Author: clebert.suconic at jboss.com
Date: 2011-11-21 10:00:10 -0500 (Mon, 21 Nov 2011)
New Revision: 11728

Modified:
   branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/stomp/StompProtocolManager.java
Log:
Stomp to throw exception on inexistent destination = HORNETQ-799

Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/stomp/StompProtocolManager.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/stomp/StompProtocolManager.java	2011-11-21 14:56:37 UTC (rev 11727)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/stomp/StompProtocolManager.java	2011-11-21 15:00:10 UTC (rev 11728)
@@ -61,6 +61,8 @@
    // Attributes ----------------------------------------------------
 
    private final HornetQServer server;
+   
+   private final SimpleString managementAddress;
 
    private final Executor executor;
 
@@ -106,6 +108,7 @@
    public StompProtocolManager(final HornetQServer server, final List<Interceptor> interceptors)
    {
       this.server = server;
+      this.managementAddress = server.getConfiguration().getManagementAddress();
       this.executor = server.getExecutorFactory().getExecutor();
    }
 
@@ -341,6 +344,8 @@
          }
          subscriptionID = "subscription/" + destination;
       }
+      
+      validateDestination(new SimpleString(destination));
       StompSession stompSession = getSession(connection);
       stompSession.setNoLocal(noLocal);
       if (stompSession.containsSubscription(subscriptionID))
@@ -583,10 +588,15 @@
     */
    private void validateDestination(SimpleString address) throws Exception, HornetQException
    {
-      Bindings binding = server.getPostOffice().lookupBindingsForAddress(address);
-      if (binding == null || binding.getBindings().size() == 0)
+      if (!address.equals(managementAddress))
       {
-         throw new HornetQException(HornetQException.ADDRESS_DOES_NOT_EXIST, "Address " + address + " has not been deployed");
+         Bindings binding = server.getPostOffice().lookupBindingsForAddress(address);
+         if (binding == null || binding.getBindings().size() == 0)
+         {
+            throw new HornetQException(HornetQException.ADDRESS_DOES_NOT_EXIST, "Address " + address +
+                                                                                " has not been deployed");
+         }
+
       }
    }
 



More information about the hornetq-commits mailing list