diff options
| author | Robert Godfrey <rgodfrey@apache.org> | 2008-03-07 15:54:41 +0000 |
|---|---|---|
| committer | Robert Godfrey <rgodfrey@apache.org> | 2008-03-07 15:54:41 +0000 |
| commit | 48fe77e5ba156f63ca7704757b298563ca77a8c1 (patch) | |
| tree | 3edc276c3ad1720f9fc8a0c1f8cc6fa255c97491 /java/client/src | |
| parent | 9751f7cd99bd405cb1ad28cf738222fcb0be4fce (diff) | |
| download | qpid-python-48fe77e5ba156f63ca7704757b298563ca77a8c1.tar.gz | |
QPID-839 : DUPS_OK should behave exactly as AUTO_ACK ... this would not cause the seen test failure; but is still incorrect
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2.1@634720 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/client/src')
| -rw-r--r-- | java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java | 40 |
1 files changed, 3 insertions, 37 deletions
diff --git a/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java b/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java index bf11572163..605e2d1e83 100644 --- a/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java +++ b/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java @@ -105,15 +105,6 @@ public class BasicMessageConsumer extends Closeable implements MessageConsumer */ private final int _acknowledgeMode; - /** Number of messages unacknowledged in DUPS_OK_ACKNOWLEDGE mode */ - private int _outstanding; - - /** - * Switch to enable sending of acknowledgements when using DUPS_OK_ACKNOWLEDGE mode. Enabled when _outstannding - * number of msgs >= _prefetchHigh and disabled at < _prefetchLow - */ - private boolean _dups_ok_acknowledge_send; - private ConcurrentLinkedQueue<Long> _unacknowledgedDeliveryTags = new ConcurrentLinkedQueue<Long>(); /** List of tags delievered, The last of which which should be acknowledged on commit in transaction mode. */ @@ -253,9 +244,6 @@ public class BasicMessageConsumer extends Closeable implements MessageConsumer switch (_acknowledgeMode) { - case Session.DUPS_OK_ACKNOWLEDGE: - _receivedDeliveryTags.add(msg.getDeliveryTag()); - break; case Session.CLIENT_ACKNOWLEDGE: _unacknowledgedDeliveryTags.add(msg.getDeliveryTag()); @@ -282,8 +270,8 @@ public class BasicMessageConsumer extends Closeable implements MessageConsumer * * @return boolean if the acquisition was successful * - * @throws JMSException - * @throws InterruptedException + * @throws JMSException if a listener has already been set or another thread is receiving + * @throws InterruptedException if interrupted */ private boolean acquireReceiving(boolean immediate) throws JMSException, InterruptedException { @@ -505,7 +493,7 @@ public class BasicMessageConsumer extends Closeable implements MessageConsumer * We can get back either a Message or an exception from the queue. This method examines the argument and deals with * it by throwing it (if an exception) or returning it (in any other case). * - * @param o + * @param o the object to return or throw * * @return a message only if o is a Message * @@ -772,28 +760,6 @@ public class BasicMessageConsumer extends Closeable implements MessageConsumer break; case Session.DUPS_OK_ACKNOWLEDGE: - /*( if (++_outstanding >= _prefetchHigh) - { - _dups_ok_acknowledge_send = true; - } - - //Can't use <= as _prefetchHigh may equal _prefetchLow so no acking would occur. - if (_outstanding < _prefetchLow) - { - _dups_ok_acknowledge_send = false; - } - - if (_dups_ok_acknowledge_send) - { - if (!_session.isInRecovery()) - { - _session.acknowledgeMessage(msg.getDeliveryTag(), true); - _outstanding = 0; - } - } - - break; - */ case Session.AUTO_ACKNOWLEDGE: // we do not auto ack a message if the application code called recover() if (!_session.isInRecovery()) |
