diff options
| author | Keith Wall <kwall@apache.org> | 2014-01-07 17:58:41 +0000 |
|---|---|---|
| committer | Keith Wall <kwall@apache.org> | 2014-01-07 17:58:41 +0000 |
| commit | fc2867bccfeab4126352e2ac5bec0a6e63b46b53 (patch) | |
| tree | d0774c95aad6ee1a8049d17e80b1839a9b519807 /qpid/java/broker-plugins | |
| parent | f7386e281f61e6921254f6da2c9aa6850a5bf722 (diff) | |
| download | qpid-python-fc2867bccfeab4126352e2ac5bec0a6e63b46b53.tar.gz | |
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
Diffstat (limited to 'qpid/java/broker-plugins')
| -rw-r--r-- | qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ExchangeBoundHandler.java | 23 |
1 files changed, 9 insertions, 14 deletions
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 StateAwareMethodListener<ExchangeBo channel.sync(); - AMQShortString exchangeName = body.getExchange(); + AMQShortString exchangeName = body.getExchange() == null ? AMQShortString.EMPTY_STRING : body.getExchange(); AMQShortString queueName = body.getQueue(); AMQShortString routingKey = body.getRoutingKey(); - if (exchangeName == null) - { - throw new AMQException("Exchange exchange must not be null"); - } Exchange exchange = virtualHost.getExchange(exchangeName.toString()); ExchangeBoundOkBody response; if (exchange == null) @@ -94,7 +89,7 @@ public class ExchangeBoundHandler implements StateAwareMethodListener<ExchangeBo response = methodRegistry.createExchangeBoundOkBody(EXCHANGE_NOT_FOUND, - new AMQShortString("Exchange " + exchangeName + " not found")); + new AMQShortString("Exchange '" + exchangeName + "' not found")); } else if (routingKey == null) { @@ -119,7 +114,7 @@ public class ExchangeBoundHandler implements StateAwareMethodListener<ExchangeBo { response = methodRegistry.createExchangeBoundOkBody(QUEUE_NOT_FOUND, // replyCode - new AMQShortString("Queue " + queueName + " not found")); // replyText + new AMQShortString("Queue '" + queueName + "' not found")); // replyText } else { @@ -133,7 +128,7 @@ public class ExchangeBoundHandler implements StateAwareMethodListener<ExchangeBo { response = methodRegistry.createExchangeBoundOkBody(QUEUE_NOT_BOUND, // replyCode - new AMQShortString("Queue " + queueName + " not bound to exchange " + exchangeName)); // replyText + new AMQShortString("Queue '" + queueName + "' not bound to exchange '" + exchangeName + "'")); // replyText } } } @@ -145,7 +140,7 @@ public class ExchangeBoundHandler implements StateAwareMethodListener<ExchangeBo { response = methodRegistry.createExchangeBoundOkBody(QUEUE_NOT_FOUND, // replyCode - new AMQShortString("Queue " + queueName + " not found")); // replyText + new AMQShortString("Queue '" + queueName + "' not found")); // replyText } else { @@ -159,8 +154,8 @@ public class ExchangeBoundHandler implements StateAwareMethodListener<ExchangeBo else { - String message = "Queue " + queueName + " not bound with routing key " + - body.getRoutingKey() + " to exchange " + exchangeName; + String message = "Queue '" + queueName + "' not bound with routing key '" + + body.getRoutingKey() + "' to exchange '" + exchangeName + "'"; if(message.length()>255) { @@ -183,8 +178,8 @@ public class ExchangeBoundHandler implements StateAwareMethodListener<ExchangeBo { response = methodRegistry.createExchangeBoundOkBody(NO_QUEUE_BOUND_WITH_RK, // replyCode - new AMQShortString("No queue bound with routing key " + body.getRoutingKey() + - " to exchange " + exchangeName)); // replyText + new AMQShortString("No queue bound with routing key '" + body.getRoutingKey() + + "' to exchange '" + exchangeName + "'")); // replyText } } session.writeFrame(response.generateFrame(channelId)); |
