Reputation: 11
In JMS,The messages are stored in a FIFO manner in case of QUEUE.But in case of Topic, How the messages are stored?? Whether in FIFO aur any other manner??
Upvotes: 1
Views: 285
Reputation: 399
JMS does not make a difference between queues and topics in the point of message ordering. However be aware that the message delivery is not FIFO in every case. The specification states: JMS defines that messages sent by a session to a destination must be received in the order they were sent (see http://docs.oracle.com/cd/E19957-01/816-5904-10/816-5904-10.pdf - chapter 4.4.10) but there are some restrictions, for example with different delivery modes or different priorities.
In many environments you will not find dependent messages sent by one session, as you will find parallelization over multiple servers or processes - therefor it is mostly not a good idea to rely on message order....
Upvotes: 0
Reputation: 13229
FIFO for topics also. That's not the difference between queues and topics.
The big difference between a Queue and a Topic is the messaging model: point-to-point vs publish/subscribe.
For this discussion, I'm ignoring durable topic subscriptions. That's a twist on Topic subscribers where messages don't get dropped for that consumer if it isn't listening when the message is sent.
Upvotes: 1