I've a publisher sending events to a durable topic subscriber over a single
broker. I was making the assumption that the messages would arrive in order
(http://activemq.apache.org/how-do-i-preserve-order-of-messages.html). The
subscriber is writing these events to a database.

Assuming I send messages 1, 2, and 3, then when my class that implements
MessageListener acknowledges message 1,  message 2 is received.

However, if I don't acknowledge receipt of message 2 (e.g. a glitch in the
network causing a JDBC error) then I still receive message 3 when the
onMessage() method completes. When I restart the application and the
connection to the broker is restarted message 2 is sent - after I've ack'ed
message 3.

Is this expected? I'm surprised to see message 2 being sent (again) after
message 3 has been ack'ed.

Thanks,

Greg

Reply via email to