summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRajith Muditha Attapattu <rajith@apache.org>2010-07-28 21:16:11 +0000
committerRajith Muditha Attapattu <rajith@apache.org>2010-07-28 21:16:11 +0000
commit4cd56165e79c211598d6adc68779346cd7ac63a2 (patch)
treeb962babbce42773418551b51c533f6643824882f
parentedcd79cd10ae0702213f3e59e49002bdd40922da (diff)
downloadqpid-python-4cd56165e79c211598d6adc68779346cd7ac63a2.tar.gz
QPID-2738
The pre-aquire flag is now computed differently for each dest syntax type. For BURL the exchange type is also queried if the Destination is not an instance of AMQTopic. For ADDR, if the browse mode is set, then pre-acquire is set to false irrespective of the node type. We still continue to use pre-acquire=false if selectors are present. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@980232 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java22
1 files changed, 19 insertions, 3 deletions
diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java b/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
index b2dce0404c..74cd0c8b78 100644
--- a/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
+++ b/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
@@ -565,9 +565,25 @@ public class AMQSession_0_10 extends AMQSession<BasicMessageConsumer_0_10, Basic
try
{
- preAcquire = ( ! consumer.isNoConsume() &&
- (consumer.getMessageSelector() == null || consumer.getMessageSelector().equals("")) )
- || !(consumer.getDestination() instanceof AMQQueue);
+ boolean isTopic;
+
+ if (consumer.getDestination().getDestSyntax() == AMQDestination.DestSyntax.BURL)
+ {
+ isTopic = consumer.getDestination() instanceof AMQTopic ||
+ consumer.getDestination().getExchangeClass().equals(ExchangeDefaults.TOPIC_EXCHANGE_CLASS) ;
+
+ preAcquire = isTopic || (!consumer.isNoConsume() &&
+ (consumer.getMessageSelector() == null || consumer.getMessageSelector().equals("")));
+ }
+ else
+ {
+ isTopic = consumer.getDestination().getAddressType() == AMQDestination.TOPIC_TYPE;
+
+ preAcquire = !consumer.isNoConsume() &&
+ (isTopic || consumer.getMessageSelector() == null ||
+ consumer.getMessageSelector().equals(""));
+ }
+
getQpidSession().messageSubscribe
(queueName.toString(), String.valueOf(tag),
getAcknowledgeMode() == NO_ACKNOWLEDGE ? MessageAcceptMode.NONE : MessageAcceptMode.EXPLICIT,