You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Pedro Sam <pe...@tvworks.com> on 2005/12/15 22:44:34 UTC

message ordering from different sessions

Hi all,

I know that the JMS spec says that if messages are sent from different sessions, 
then reception ordering is undefined.  I'm just wondering what the behaviour 
would be for ActiveMQ.

For example, a single threaded app does the following:

	- create session_foo and session_bar
	- sends msg_foo from session_foo
	- sends msg_bar from session_bar

Does ActiveMQ preserve the ordering of the messages in this setup?
	
Thanks,
Pedro

-- 
Power corrupts.  Absolute power corrupts absolutely.  It rocks absolutely, too.
-- despair.com

Re: message ordering from different sessions

Posted by James Strachan <ja...@gmail.com>.
On 15 Dec 2005, at 21:44, Pedro Sam wrote:
> Hi all,
>
> I know that the JMS spec says that if messages are sent from  
> different sessions, then reception ordering is undefined.  I'm just  
> wondering what the behaviour would be for ActiveMQ.
>
> For example, a single threaded app does the following:
>
> 	- create session_foo and session_bar
> 	- sends msg_foo from session_foo
> 	- sends msg_bar from session_bar
>
> Does ActiveMQ preserve the ordering of the messages in this setup?

In ActiveMQ order is preserved once the messages hit the connection  
(which has the Transport inside it). So if 1 thread sends foo then  
bar, then foo will be delivered before bar in all consumers. So order  
is preserved for each thread sending on the same connection.

Incidentally we also have support for total ordering too...
http://activemq.org/Total+Ordering

which is great if you want all of the consumers to see exactly the  
same order of messages.

James
-------
http://radio.weblogs.com/0112098/