-
1. Re: Consuming out of order messages when recovering from crash
clebert.suconic Oct 22, 2010 1:02 PM (in response to leo.franca)This has been asked a few times already:
- look at consumer cache, If you want strict ordering in the presence of redelivery, you must disable client cache. Messages are sent ahead to the client to maximize throughput avoiding network latency. In case of failure the messages that were on the cache will be sent back to the queue, what could apparently cause ordering issues as the whole buffer needs to be redelivered.
You need to choose a tradeof between throughput and strict ordering.
-
2. Re: Consuming out of order messages when recovering from crash
clebert.suconic Oct 22, 2010 3:20 PM (in response to clebert.suconic)Added this to the FAQ: http://community.jboss.org/wiki/HornetQTechnicalFAQ
-
3. Re: Consuming out of order messages when recovering from crash
timfox Oct 25, 2010 6:34 AM (in response to clebert.suconic)Hmmm. Messages shouldn't be delivered out of order even in the case of redelivery.
Redelivery should work as follows:
1) The server consumer is stopped.
2) Delivered but not acked messages are returned to the queue
3) Any messages in the client buffer are cancelled to the queue
4) The server consumer is restarted
(Take a look at the code in rollback to see this)
This should mean the order is preserved, irrespective of consumer buffering.
Of course, this only applies in the case of a single consumer on a queue. If you have more than once consumer on a queue all bets are off since the order in which messages are consumed is determined by the user, so is indeterminate.
-
4. Re: Consuming out of order messages when recovering from crash
clebert.suconic Oct 25, 2010 9:54 AM (in response to timfox)I assumed he was using multiple consumers (which is probably the case).
If that's not the case, @Leo Franca: can you provide a working example? Take a look if that's the case first please.
-
5. Re: Consuming out of order messages when recovering from crash
timfox Oct 25, 2010 12:22 PM (in response to clebert.suconic)If he's using multiple consumers, setting consumer-window-size to 0 won't help things.
At the end of the day with multiple consumers we can't make any guarantees about ordering on redelivery since it's not under our control.
E.g. if there are messages A, B, C, D, E in the queue
and
Consumer C1 consumes messages A, B
Consumer C2 consumes messages C, D
Consumer C1 consumers message E
Consumer C2 rolls back C, D
So Consumer C1 will receive messages C, D out of order.
There's nothing we can do about that, since it depends on the when the user consumes and rolls back.
-
6. Re: Consuming out of order messages when recovering from crash
clebert.suconic Oct 25, 2010 1:23 PM (in response to timfox)sure, I guess this behaviour would be probably expected from most users...
What I have seen users complaining is messages that they didn't consume being redelivered out of order.
That would be fixed with Message Group anyway.
Also: @Leo: Look at Message group.
-
7. Re: Consuming out of order messages when recovering from crash
leo.franca Oct 25, 2010 2:57 PM (in response to clebert.suconic)Hi guys, thanks for the response. I m using 1 consumer and 1 producer only. If you want I can paste my code here. Its a very simple producer/consumer.
-
8. Re: Consuming out of order messages when recovering from crash
clebert.suconic Oct 25, 2010 3:12 PM (in response to leo.franca)Yes, please... attach some simple test reproducing the issue.
-
9. Re: Consuming out of order messages when recovering from crash
clebert.suconic Oct 25, 2010 3:26 PM (in response to clebert.suconic)Also: if you could please try with trunk.