• Post Reply Bookmark Topic Watch Topic
  • New Topic

JMS - Sequencing  RSS feed

 
PNS Subramanian
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure if this is the correct forum - please redirect if otherwise.

Is there a way to ensure sequencing of messages in JMS - suppose there are two events A,B. A is published before B. Both events have the same subscriber. Is there a guarantee that subscriber(s) would first receive A and then would receive B ? If not, how do we ensure that ?
 
Osuwari Inu
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Short answer: no, it is not possible.
Long answer: it might be.

JMS is asynchronous by design. It is likely that messages are received in the same order as they are send, but by no means guaranteed.
Depending on the underlying transport service (e.g. WebSphere MQ) it may be possible to configure it to always deliver the messages in sequence. But one would have to take care that priorities on messages remain the same.

If you need several messages to be processed in order, as in all or none, you might consider logical message groups.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!