JMS Queue Receiving Order

I add two JMS messages in the same destination sequentially. Will both of these messages be received in the same order in which I added them, or is there a chance of reverse ordering, that is, when the message is first received at the destination, it will be received first.

I add to the destination as:

producer.send(Msg1);
producer.send(Msg2);

Msg1and Msg2will be added sequentially in all cases (for example, network failures and latency, etc.)?

+3
source share
2 answers

( ) JMS . . Stack JMS?.

+5

JMS2

JMS defines that messages sent by a session to a destination must be received
in the order in which they were sent. This defines a partial ordering
constraint on a session’s input message stream.

JMS does not define order of message receipt across destinations or across
a destination’s messages sent from multiple sessions. This aspect of a
session’s input message stream order is timing-dependent. It is not under    
application control.

Although clients loosely view the messages they produce within a session
as forming a serial stream of sent messages, the total ordering of this stream
is not significant. The only ordering that is visible to receiving clients is
the order of messages a session sends to a particular destination.
Several things can affect this order like message priority, 
persistent/non persistent etc.

, , , . , , / ..

+2

Source: https://habr.com/ru/post/1787385/


All Articles