-
Story
-
Resolution: Won't Do
-
Minor
-
None
-
A-MQ 7.0.0.CR1
-
None
-
None
-
Release Notes, Compatibility/Configuration, User Experience
I believe broker should refuse or warn user to create a queue with set only purgeOnNoConsumers to true, and with default maxConsumers used = 0.
This effectively blocks any receiving of messages from this queue.
1) Create queue with defined purgeOnNoConsumers as True
java -jar /var/dtests/node_data/clients/amqx.jar queue --host <host>:1099 --action add --delete-on-no-consumer True -n purge
2) Send few messages to this queue
java -jar /var/dtests/node_data/clients/aac1.jar sender --log-msgs interop --broker <host>:61616 --conn-username admin --conn-password admin --address lala --count 5 --msg-correlation-id blabla {'durable': True, 'priority': 4, 'ttl': 0, 'first-acquirer': False, 'delivery-count': 0, 'id': 'bb4358aa-5820-4c52-ac3f-e7bc282b8e07:1:1:1-1', 'user-id': None, 'address': 'lala', 'subject': None, 'reply-to': None, 'correlation-id': 'blabla', 'content-type': None, 'content-encoding': None, 'absolute-expiry-time': 0, 'creation-time': 1493134653791, 'group-id': None, 'group-sequence': 0, 'reply-to-group-id': None, 'properties': {'JMSXDeliveryCount': 1}, 'content': None} {'durable': True, 'priority': 4, 'ttl': 0, 'first-acquirer': False, 'delivery-count': 0, 'id': 'bb4358aa-5820-4c52-ac3f-e7bc282b8e07:1:1:1-2', 'user-id': None, 'address': 'lala', 'subject': None, 'reply-to': None, 'correlation-id': 'blabla', 'content-type': None, 'content-encoding': None, 'absolute-expiry-time': 0, 'creation-time': 1493134653873, 'group-id': None, 'group-sequence': 0, 'reply-to-group-id': None, 'properties': {'JMSXDeliveryCount': 1}, 'content': None} {'durable': True, 'priority': 4, 'ttl': 0, 'first-acquirer': False, 'delivery-count': 0, 'id': 'bb4358aa-5820-4c52-ac3f-e7bc282b8e07:1:1:1-3', 'user-id': None, 'address': 'lala', 'subject': None, 'reply-to': None, 'correlation-id': 'blabla', 'content-type': None, 'content-encoding': None, 'absolute-expiry-time': 0, 'creation-time': 1493134653892, 'group-id': None, 'group-sequence': 0, 'reply-to-group-id': None, 'properties': {'JMSXDeliveryCount': 1}, 'content': None} {'durable': True, 'priority': 4, 'ttl': 0, 'first-acquirer': False, 'delivery-count': 0, 'id': 'bb4358aa-5820-4c52-ac3f-e7bc282b8e07:1:1:1-4', 'user-id': None, 'address': 'lala', 'subject': None, 'reply-to': None, 'correlation-id': 'blabla', 'content-type': None, 'content-encoding': None, 'absolute-expiry-time': 0, 'creation-time': 1493134653900, 'group-id': None, 'group-sequence': 0, 'reply-to-group-id': None, 'properties': {'JMSXDeliveryCount': 1}, 'content': None} {'durable': True, 'priority': 4, 'ttl': 0, 'first-acquirer': False, 'delivery-count': 0, 'id': 'bb4358aa-5820-4c52-ac3f-e7bc282b8e07:1:1:1-5', 'user-id': None, 'address': 'lala', 'subject': None, 'reply-to': None, 'correlation-id': 'blabla', 'content-type': None, 'content-encoding': None, 'absolute-expiry-time': 0, 'creation-time': 1493134653909, 'group-id': None, 'group-sequence': 0, 'reply-to-group-id': None, 'properties': {'JMSXDeliveryCount': 1}, 'content': None}
3) Receive those messages
[0,root@r7x0_mtoth ~]$ java -jar /var/dtests/node_data/clients/aac1.jar receiver --log-msgs interop --conn-username admin --conn-password admin --address purgeMe --count 2 18:24:54,485 ERROR Exception while consuming message! javax.jms.JMSException: AMQ219005: error creating consumer, AMQ119200: Maximum Consumer Limit Reached on Queue:(address=purgeMe,queue=purgeMe) [condition = amqp:internal-error] at org.apache.qpid.jms.provider.amqp.AmqpSupport.convertToException(AmqpSupport.java:164) at org.apache.qpid.jms.provider.amqp.AmqpSupport.convertToException(AmqpSupport.java:117) at org.apache.qpid.jms.provider.amqp.builders.AmqpResourceBuilder.handleClosed(AmqpResourceBuilder.java:172) at org.apache.qpid.jms.provider.amqp.builders.AmqpResourceBuilder.processRemoteClose(AmqpResourceBuilder.java:116) at org.apache.qpid.jms.provider.amqp.AmqpProvider.processUpdates(AmqpProvider.java:884) at org.apache.qpid.jms.provider.amqp.AmqpProvider.access$1800(AmqpProvider.java:93) at org.apache.qpid.jms.provider.amqp.AmqpProvider$18.run(AmqpProvider.java:789) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)
4) Observe that purgeOnNoConsumers is True, maxConsumers by default 0.
java -jar /var/dtests/node_data/clients/amqx.jar queue --action properties -n purgeMe {'temporary': False, 'numberOfBytesPerPage': 10485760, 'paused': False, 'messageCount': 0, 'roles': [['amq',True,True,True,True,True,True,True]], 'address-settings': {'slowConsumerThreshold': -1, 'pageCacheMaxSize': 5, 'autoCreateJmsQueues': True, 'autoDeleteJmsTopics': True, 'maxRedeliveryDelay': 0, 'pageSizeBytes': 10485760, 'addressFullMessagePolicy': 'PAGE', 'autoCreateAddress': True, 'maxSizeBytes': -1, 'expiryAddress': 'ExpiryQueue', 'redistributionDelay': -1, 'autoDeleteQueues': True, 'redeliveryMultiplier': 1, 'slowConsumerPolicy': 'NOTIFY', 'lastValueQueue': False, 'maxDeliveryAttempts': 10, 'expiryDelay': -1, 'sendToDLAOnNoRoute': False, 'autoCreateJmsTopics': True, 'DLA': 'DLQ', 'redeliveryDelay': 0, 'autoDeleteJmsQueues': True, 'slowConsumerCheckPeriod': 5, 'autoDeleteAddress': True, 'autoCreateQueues': True}, 'messagesAcknowledged': 0, 'deadLetterAddress': 'DLQ', 'durable': False, 'numberOfPages': 0, 'deliveringCount': 0, 'messagesKilled': 0, 'messagesExpired': 0, 'numberOfMessages': 0, 'expiryAddress': 'ExpiryQueue', 'bindingNames': ['purgeMe'], 'messagesAdded': 0, 'address': 'purgeMe', 'consumerCount': 0, 'queueNames': ['purgeMe'], 'scheduledCount': 0, 'purgeOnNoConsumers': True, 'paging': False, 'maxConsumers': 0, 'addressSize': 0, 'name': 'purgeMe', 'iD': 31}
Update:
Currently, upstream docs only say:
When purge-on-no-consumers is set to true. The queue will not start receiving messages until a consumer is attached. When the last consumer is detached from the queue. The queue is purged (it's messages are removed) and will not receive any more messages until a new consumer is attached.
Nothing about max consumer should be bigger then 0, which is default value and makes this feature unusable.
- is related to
-
ENTMQBR-647 purgeOnNoConsumer is not working properly
- Closed
- relates to
-
ENTMQBR-648 JMS Openwire client is unable to send messages to queue with defined 'purgeOnNoConsumer' or queue 'filter'
- Closed