Author: clebert.suconic(a)jboss.com
Date: 2011-11-21 15:43:40 -0500 (Mon, 21 Nov 2011)
New Revision: 11732
Modified:
branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/stomp/StompProtocolManager.java
Log:
Stomp to throw exception on inexistent destination = HORNETQ-799
Modified:
branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/stomp/StompProtocolManager.java
===================================================================
---
branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/stomp/StompProtocolManager.java 2011-11-21
20:42:38 UTC (rev 11731)
+++
branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/stomp/StompProtocolManager.java 2011-11-21
20:43:40 UTC (rev 11732)
@@ -53,6 +53,10 @@
{
// Constants -----------------------------------------------------
+ private static final SimpleString JMS_TOPIC_PREFIX = new
SimpleString("jms.topic");
+
+ private static final SimpleString JMS_QUEUE_PREFIX = new
SimpleString("jms.queue");
+
private static final Logger log = Logger.getLogger(StompProtocolManager.class);
// TODO use same value than HornetQConnection
@@ -588,7 +592,7 @@
*/
private void validateDestination(SimpleString address) throws Exception,
HornetQException
{
- if (!address.equals(managementAddress))
+ if ((address.startsWith(JMS_QUEUE_PREFIX) || address.startsWith(JMS_TOPIC_PREFIX))
&& !address.equals(managementAddress))
{
Bindings binding = server.getPostOffice().lookupBindingsForAddress(address);
if (binding == null || binding.getBindings().size() == 0)