From fc2867bccfeab4126352e2ac5bec0a6e63b46b53 Mon Sep 17 00:00:00 2001 From: Keith Wall Date: Tue, 7 Jan 2014 17:58:41 +0000 Subject: QPID-5420: Restore ability to consume using BURLs specifying default exchange. * Java Broker: Changed AbstractVirtualHost so that createExchange throws ExchangeExistException before checking for a reserved exchnage name. The effect will be that the Java Broker will again accept active declaration of the built in exchanges (amq.*, qpid.* and default). * Java Broker: Changed the 0-8..0-9-1 ExchangeBoundHandler so that a null exchnage name is treated to mean the default exchange. This matches the behaviour of ServerSessionDelegate#exchangeBound() on the 0-10 path. This allows the Java client to query bindings on the default exchange. * Client: Changed AbstractAMQMessageDelegate.java so that 0-10 knows the type of the default exchange when populating the JMSDestination on received messages. * Client: Introduced system property qpid.bind_queues system property so that the exchange/queue bind side effect can be suppressed on consumer creation. Like qid.declare_exchanges and declare_queues, this system propery has effect when using BURLs. Might be useful if using a new client with older broker. * Added new system tests. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1556292 13f79535-47bb-0310-9956-ffa450edef68 --- .../server/virtualhost/AbstractVirtualHost.java | 10 +- .../v0_8/handler/ExchangeBoundHandler.java | 23 ++--- .../java/org/apache/qpid/client/AMQSession.java | 14 ++- .../qpid/client/BasicMessageConsumer_0_8.java | 2 +- .../client/message/AbstractAMQMessageDelegate.java | 5 +- .../qpid/configuration/ClientProperties.java | 6 ++ .../test/client/message/JMSDestinationTest.java | 110 +++++++++------------ .../client/DynamicQueueExchangeCreateTest.java | 23 +++++ 8 files changed, 107 insertions(+), 86 deletions(-) (limited to 'qpid/java') diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java index 0cd4f0b6b2..5859ce3c68 100644 --- a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java +++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java @@ -563,11 +563,6 @@ public abstract class AbstractVirtualHost implements VirtualHost, IConnectionReg String alternateExchangeName) throws AMQException { - - if(_exchangeRegistry.isReservedExchangeName(name)) - { - throw new ReservedExchangeNameException(name); - } synchronized (_exchangeRegistry) { Exchange existing; @@ -575,6 +570,11 @@ public abstract class AbstractVirtualHost implements VirtualHost, IConnectionReg { throw new ExchangeExistsException(name,existing); } + if(_exchangeRegistry.isReservedExchangeName(name)) + { + throw new ReservedExchangeNameException(name); + } + Exchange alternateExchange; if(alternateExchangeName != null) diff --git a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ExchangeBoundHandler.java b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ExchangeBoundHandler.java index 0535236f94..4ebddb0f68 100644 --- a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ExchangeBoundHandler.java +++ b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ExchangeBoundHandler.java @@ -29,7 +29,6 @@ import org.apache.qpid.server.protocol.v0_8.AMQChannel; import org.apache.qpid.server.exchange.Exchange; import org.apache.qpid.server.protocol.v0_8.AMQProtocolSession; import org.apache.qpid.server.queue.AMQQueue; -import org.apache.qpid.server.queue.QueueRegistry; import org.apache.qpid.server.protocol.v0_8.state.AMQStateManager; import org.apache.qpid.server.protocol.v0_8.state.StateAwareMethodListener; import org.apache.qpid.server.virtualhost.VirtualHost; @@ -80,13 +79,9 @@ public class ExchangeBoundHandler implements StateAwareMethodListener255) { @@ -183,8 +178,8 @@ public class ExchangeBoundHandler implements StateAwareMethodListener