You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Steven Marcus <st...@gmail.com> on 2007/01/30 06:57:48 UTC

total ordering v. dedicated connection

Hello!

I have a spring message-driven pojo (via SimpleMessageListener) that
is receiving messages out of order ('cancel' before 'new')
occasionally.

There is only one message producer, but it's using JmsTemplate, which
is configured with an activemq PooledConnectionFactory.

The example at http://www.activemq.org/site/total-ordering.html
focuses on two producers, but I am working on the theory that a single
producer may create out of order messages given connection pooling.

Is this correct?
Is there any way to configure the topic for total ordering via the API?
Would it be better to stop using JmsTemplate and provide the single
producer a dedicated connection?

Thanks in advance from an activemq/jms newbie...
Steven Marcus

Re: total ordering v. dedicated connection

Posted by James Strachan <ja...@gmail.com>.
On 1/30/07, Rob Davies <ra...@gmail.com> wrote:
>
> Hi Steven,
>
> I think your spot on that the connection pooling could be causing you
> problems. I would recommend that you use a dedicated connection - and
> apart from seeing messages in order, you'll see performance
> improvements too!

Agreed. To be honest, a JmsTemplate doesn't buy you a whole lot in
terms of functionality (it often seems to cause more pain than its
worth); its pretty easy to write a little spring bean which implements
InitalizingBean / DisposableBean so it can create/destroy the JMS
connection/session/producer, then reuse the same producer/connection
for each message to ensure ordering.

-- 

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

Re: total ordering v. dedicated connection

Posted by Rob Davies <ra...@gmail.com>.
Hi Steven,

I think your spot on that the connection pooling could be causing you  
problems. I would recommend that you use a dedicated connection - and  
apart from seeing messages in order, you'll see performance  
improvements too!

cheers,

Rob

On 30 Jan 2007, at 05:57, Steven Marcus wrote:

> Hello!
>
> I have a spring message-driven pojo (via SimpleMessageListener) that
> is receiving messages out of order ('cancel' before 'new')
> occasionally.
>
> There is only one message producer, but it's using JmsTemplate, which
> is configured with an activemq PooledConnectionFactory.
>
> The example at http://www.activemq.org/site/total-ordering.html
> focuses on two producers, but I am working on the theory that a single
> producer may create out of order messages given connection pooling.
>
> Is this correct?
> Is there any way to configure the topic for total ordering via the  
> API?
> Would it be better to stop using JmsTemplate and provide the single
> producer a dedicated connection?
>
> Thanks in advance from an activemq/jms newbie...
> Steven Marcus