Description of problem: When a consumer performs a graceful shutdown on the connection, the buffered messages aren't returned back. But attempts to redeliver to the same thread as per the redelivery-delay configuration. This causes a message starvation for the next immediate client. Please refer https://issues.jboss.org/browse/HORNETQ-1259 for more information Version-Release number of selected component (if applicable): HornetQ-2.3.1, JBoss-EAP-6.1.1 How reproducible: Always Steps to Reproduce: 1. Create a destination, queue/M on HornetQ 2. Send about 200 messages to queue/M 3. Please run a JMS consumer to sonsume 2-3 messages and perform a graceful shutdown 4. You would see xyz number of pending/scheduled messages allocated for the JMS client who has terminated gracefully 5. Start the another JMS client client, this second JMS client won't be able to consume messages for 60 seconds. In other words, the messages in the destination have been scheduled for the terminated client and aren't available for this client. 5. The JMS broker retains messages as per the configured redelivery-delay attribute. Actual results: The messages aren't available for the next immediate JMS client Expected results: The messages should be available for the next immediate client irrespective of the value been specified for redelivery-delay Additional info:
https://github.com/hornetq/hornetq/pull/1313 Testcase included
Tested with EAP 6.2.0.ER6 / HornetQ 2.3.9.Final