From ea005b93d8bbbec46038774e86cb5ec4c9c6d72c Mon Sep 17 00:00:00 2001 From: Arnaud Simon Date: Tue, 2 Oct 2007 15:33:14 +0000 Subject: Changed isqueueBound for handling null routing key git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@581279 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/qpid/client/AMQSession_0_10.java | 24 ++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'qpid/java') diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java index 7916dd0d0e..2b29ed3817 100644 --- a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java +++ b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java @@ -297,13 +297,25 @@ public class AMQSession_0_10 extends AMQSession public boolean isQueueBound(final AMQShortString exchangeName, final AMQShortString queueName, final AMQShortString routingKey) throws JMSException { - Future result = getQpidSession().bindingQuery(exchangeName.toString(), queueName.toString(), routingKey.toString(), null); + String rk = ""; + boolean res; + if (routingKey != null) + { + rk = routingKey.toString(); + } + Future result = + getQpidSession().bindingQuery(exchangeName.toString(), queueName.toString(), rk, null); BindingQueryResult bindingQueryResult = result.get(); - return ! (bindingQueryResult.getArgsNotMatched() || - bindingQueryResult.getExchangeNotFound() || - bindingQueryResult.getKeyNotMatched() || - bindingQueryResult.getQueueNotFound() || - bindingQueryResult.getQueueNotMatched()); + if (routingKey == null) + { + res = !(bindingQueryResult.getExchangeNotFound() || bindingQueryResult.getQueueNotFound()); + } + else + { + res = !(bindingQueryResult.getKeyNotMatched() || bindingQueryResult.getQueueNotFound() || bindingQueryResult + .getQueueNotMatched()); + } + return res; } /** -- cgit v1.2.1