Details
Description
Current Behavior:
Given that a Stomp client SUBSCRIBEs to a queue with the ack mode set to 'client';
Scenario 1:
Some producer send messages and the Stomp Subscriber receives the ff. messages in order:
Msg1
Msg2
Msg3
ACK Msg1 will acknowledge just Msg1. This is a simple and obvious behavior.
ACK Msg2, ACK Msg3 should behave normal.
====
Scenario 2:
Some producer send messages and the Stomp Subscriber receives the ff. messages in order:
Msg1
Msg2
Msg3
Trying to do an ACK Msg2 will acknowledge both Msg1 and Msg2. Any attempt to ACK Msg1 will result in an Unexpected ACK error frame.
ACK Msg3 will succeed.
====
Scenario 3:
Again, some producer send messages and the Stomp Subscriber receives the ff. messages in order:
Msg1
Msg2
Msg3
Trying to ACK Msg3 will acknowledge ALL messages at once. ACK Msg2 or Msg 1 will raise an exception if attempted.
====
The Stomp specs at http://stomp.codehaus.org/Protocol does not detail the ack behavior nor does it recommend or hint anything.
Proposed Patch:
Introduce a new ack mode in Stomp SUBSCRIBE header:
In the attached patch, the chosen header is called 'client-individual'; to reflect that ACKs are still client initiated PLUS "individual" to
declare that the client intends to acknowledge individual messages by message-id, not in batches as with simple 'client' ack mode.
Kindly suggest a another header name if you can think of a more appropriate one.
References:
https://issues.apache.org/activemq/browse/AMQ-1732
Thank you.
===========
Dexter Tad-y