diff options
author | Robert Gemmell <robbie@apache.org> | 2010-12-20 14:11:28 +0000 |
---|---|---|
committer | Robert Gemmell <robbie@apache.org> | 2010-12-20 14:11:28 +0000 |
commit | 3a4a5a79c0856f93f0f52ab0522efcaabecbd42d (patch) | |
tree | 6ad2a3bfcf2712ddb201fbd61bce220b9bf8011b | |
parent | 3eed6e502294971ecefab89b2b5dbdbf5f3afe4c (diff) | |
download | qpid-python-3a4a5a79c0856f93f0f52ab0522efcaabecbd42d.tar.gz |
QPID-2971: add system property to allow overriding disabling of MaxDelivery for autodelete queues
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/0.5.x-dev@1051113 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java | 5 | ||||
-rw-r--r-- | qpid/java/client/src/main/java/org/apache/qpid/client/configuration/ClientProperties.java | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java b/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java index 3b649e41d2..0915aedb00 100644 --- a/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java +++ b/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java @@ -115,7 +115,8 @@ public abstract class BasicMessageConsumer<U> extends Closeable implements Messa private int _maxDeliveryAttempts = 0; private boolean _maxRedeliverEnabled = false; - + private boolean _maxDeliveryAutodeleteEnabled = + Boolean.getBoolean(ClientProperties.MAX_DELIVERY_AUTODELETE_PROP_NAME); private final DeliveryCountTracker _tracker; /** @@ -179,7 +180,7 @@ public abstract class BasicMessageConsumer<U> extends Closeable implements Messa int idMapSize = Integer.getInteger(ClientProperties.MAX_DELIVERY_RECORDS_PROP_NAME, Math.max(2 * _prefetchHigh, 20)); Integer maxDeliveries = destination.getMaxDeliveryCount(); _maxDeliveryAttempts = maxDeliveries == null ? connection.getMaxDeliveryCount() : maxDeliveries; - _maxRedeliverEnabled = _maxDeliveryAttempts > 0 && !destination.isAutoDelete(); + _maxRedeliverEnabled = _maxDeliveryAttempts > 0 && (!destination.isAutoDelete() || _maxDeliveryAutodeleteEnabled); _tracker = isMaxDeliveryCountEnforced() ? new DeliveryCountTracker(idMapSize) : null; } diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/configuration/ClientProperties.java b/qpid/java/client/src/main/java/org/apache/qpid/client/configuration/ClientProperties.java index 3a1f9d4818..831fcce83d 100644 --- a/qpid/java/client/src/main/java/org/apache/qpid/client/configuration/ClientProperties.java +++ b/qpid/java/client/src/main/java/org/apache/qpid/client/configuration/ClientProperties.java @@ -82,6 +82,11 @@ public class ClientProperties * per-consumer for use in enforcing maximum delivery count. */ public static final String MAX_DELIVERY_RECORDS_PROP_NAME = "qpid.max.delivery.records"; + + /** + * System property to override whether max delivery count is disabled when using autodelete queues. + */ + public static final String MAX_DELIVERY_AUTODELETE_PROP_NAME = "qpid.max.delivery.autodelete"; /** * ========================================================== |