Author: arnaudsimon
Date: Tue Oct 2 08:33:14 2007
New Revision: 581279
URL: http://svn.apache.org/viewvc?rev=581279&view=rev
Log:
Changed isqueueBound for handling null routing key
Modified:
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
Modified:
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java?rev=581279&r1=581278&r2=581279&view=diff
==============================================================================
---
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
(original)
+++
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
Tue Oct 2 08:33:14 2007
@@ -297,13 +297,25 @@
public boolean isQueueBound(final AMQShortString exchangeName, final
AMQShortString queueName,
final AMQShortString routingKey) throws
JMSException
{
- Future<BindingQueryResult> result =
getQpidSession().bindingQuery(exchangeName.toString(), queueName.toString(),
routingKey.toString(), null);
+ String rk = "";
+ boolean res;
+ if (routingKey != null)
+ {
+ rk = routingKey.toString();
+ }
+ Future<BindingQueryResult> 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;
}
/**