diff options
| author | Rajith Muditha Attapattu <rajith@apache.org> | 2010-07-28 21:16:11 +0000 |
|---|---|---|
| committer | Rajith Muditha Attapattu <rajith@apache.org> | 2010-07-28 21:16:11 +0000 |
| commit | 17d3396edf041440c05ec447b72d25eda5068f5e (patch) | |
| tree | b962babbce42773418551b51c533f6643824882f /java/client/src | |
| parent | 184c59fe476c790810382b9c44a716724cf6e834 (diff) | |
| download | qpid-python-17d3396edf041440c05ec447b72d25eda5068f5e.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
Diffstat (limited to 'java/client/src')
| -rw-r--r-- | java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java | 22 |
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, |
