PDA

View Full Version : Preserving order off of JMS Topic/Queue



virtualandy
Jan 21st, 2010, 09:34 PM
I apologize in advance for not doing enough research, but just stumbled across a problem with a competing "ESB" software framework and might need a quick fix. Naturally, Spring Integration seems like it would be a good fit.

Here's what we want to do:
Receive messages off a JMS topic in the order that they were placed (we listen to an existing JMS topic)
Place these messages onto an in-memory or JMS queue
Have a singleton/single threaded POJO that reads the queue, preserving order (FIFO).

This seems like it should be simple/doable, but the other framework is giving us fits. Can Spring Integration save my day? ;)

Thanks,

Andy

rganger
Jan 22nd, 2010, 07:24 AM
In my experience with jms topics, they are not guaranteed to be ordered. If you instead used a jms queue to receive the messages, then they would be guaranteed to be ordered. Once you receive them into Spring Integration, they can be placed on a single-threaded direct channel to process them one at a time.