BTM+Spring+ActiveMQ : Message on Queue not consumed

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

BTM+Spring+ActiveMQ : Message on Queue not consumed

Kiwiland
Hi,
 I'm using PoolingConnectionFactory on ActiveMQ. I'm running into some strange problems where the message on the queues are not getting consumed. Say there are 10 queues and a message is moving from Queue 1 -> Queue 2 and so on. After some point say Queue3, the message is no longer getting consumed. When I re-run the Junit test, the message gets picked up and moves onto say Queue6 and then stops. I can't seem to figure out what's going on. I did enable TRACE on the logs and looked quite a bit. I'd really appreciate any thoughts. Thanks.

When I tested with Spring's org.springframework.jms.connection.CachingConnectionFactory, it seems to work fine.
 
My configuration:
        <bean id="connectionFactory" class="bitronix.tm.resource.jms.PoolingConnectionFactory" init-method="init" destroy-method="close">
                <property name="className" value="org.apache.activemq.ActiveMQXAConnectionFactory" />
                <property name="uniqueName" value="activemq" />
                <property name="minPoolSize" value="1" />
                <property name="maxPoolSize" value="2" />
                <property name="allowLocalTransactions" value="false" />
                <property name="driverProperties">
                        <props>
                                <prop key="brokerURL">${BROKER.URL}?jms.redeliveryPolicy.maximumRedeliveries=${JMS_REDELIVERIES_MAX:5}&jms.redeliveryPolicy.initialRedeliveryDelay=${JMS_REDELIVERIES_INITIAL_DELAY:1000}</prop>
                        </props>
                </property>
        </bean>
 
 
My Environment:
BTM 2.1.1, Spring Integration 2.0.4, Spring 3.0.

Cheers!
Reply | Threaded
Open this post in threaded view
|

Re: BTM+Spring+ActiveMQ : Message on Queue not consumed

Kiwiland
Just an Update:

While I'm still working on fixing this issue, I noticed that when I set both the minPoolSize and maxPoolSize to 1, the messages are being read off of the Queue nicely as expected. Any value of maxPoolSize > 1 is causing a problem. I tested it at least a dozen times just to make sure that my findings were accurate. Any thoughts on why this may be happening? Thanks.

Cheers!


Kiwiland wrote
Hi,
 I'm using PoolingConnectionFactory on ActiveMQ. I'm running into some strange problems where the message on the queues are not getting consumed. Say there are 10 queues and a message is moving from Queue 1 -> Queue 2 and so on. After some point say Queue3, the message is no longer getting consumed. When I re-run the Junit test, the message gets picked up and moves onto say Queue6 and then stops. I can't seem to figure out what's going on. I did enable TRACE on the logs and looked quite a bit. I'd really appreciate any thoughts. Thanks.

When I tested with Spring's org.springframework.jms.connection.CachingConnectionFactory, it seems to work fine.
 
My configuration:
        <bean id="connectionFactory" class="bitronix.tm.resource.jms.PoolingConnectionFactory" init-method="init" destroy-method="close">
                <property name="className" value="org.apache.activemq.ActiveMQXAConnectionFactory" />
                <property name="uniqueName" value="activemq" />
                <property name="minPoolSize" value="1" />
                <property name="maxPoolSize" value="2" />
                <property name="allowLocalTransactions" value="false" />
                <property name="driverProperties">
                        <props>
                                <prop key="brokerURL">${BROKER.URL}?jms.redeliveryPolicy.maximumRedeliveries=${JMS_REDELIVERIES_MAX:5}&jms.redeliveryPolicy.initialRedeliveryDelay=${JMS_REDELIVERIES_INITIAL_DELAY:1000}</prop>
                        </props>
                </property>
        </bean>
 
 
My Environment:
BTM 2.1.1, Spring Integration 2.0.4, Spring 3.0.

Cheers!
Reply | Threaded
Open this post in threaded view
|

Re: BTM+Spring+ActiveMQ : Message on Queue not consumed

Ludovic Orban-2
The problem certainly lies somwhere in ActiveMQ's code.

You may try tuning the Spring DefaultMessageListenerContainer (it caching can confuse ActiveMQ a lot) and maybe disable BTM PoolingDataSource's cacheProducersConsumers property as well.

Other than that, I can only recommend you to use a different JMS server with a better working XA support, or to eventually try LRC.


2011/10/4 Kiwiland <[hidden email]>

Just an Update:

While I'm still working on fixing this issue, I noticed that when I set both
the minPoolSize and maxPoolSize to 1, the messages are being read off of the
Queue nicely as expected. Any value of maxPoolSize > 1 is causing a problem.
I tested it at least a dozen times just to make sure that my findings were
accurate. Any thoughts on why this may be happening? Thanks.

Cheers!



Kiwiland wrote:
>
> Hi,
>  I'm using PoolingConnectionFactory on ActiveMQ. I'm running into some
> strange problems where the message on the queues are not getting consumed.
> Say there are 10 queues and a message is moving from Queue 1 -> Queue 2
> and so on. After some point say Queue3, the message is no longer getting
> consumed. When I re-run the Junit test, the message gets picked up and
> moves onto say Queue6 and then stops. I can't seem to figure out what's
> going on. I did enable TRACE on the logs and looked quite a bit. I'd
> really appreciate any thoughts. Thanks.
>
> When I tested with Spring's
> org.springframework.jms.connection.CachingConnectionFactory, it seems to
> work fine.
>
> My configuration:
>       <bean id="connectionFactory"
> class="bitronix.tm.resource.jms.PoolingConnectionFactory"
> init-method="init" destroy-method="close">
>               <property name="className"
> value="org.apache.activemq.ActiveMQXAConnectionFactory" />
>               <property name="uniqueName" value="activemq" />
>               <property name="minPoolSize" value="1" />
>               <property name="maxPoolSize" value="2" />
>               <property name="allowLocalTransactions" value="false" />
>               <property name="driverProperties">
>                       <props>
>                               <prop
> key="brokerURL">${BROKER.URL}?jms.redeliveryPolicy.maximumRedeliveries=${JMS_REDELIVERIES_MAX:5}&amp;jms.redeliveryPolicy.initialRedeliveryDelay=${JMS_REDELIVERIES_INITIAL_DELAY:1000}</prop>
>                       </props>
>               </property>
>       </bean>
>
>
> My Environment:
> BTM 2.1.1, Spring Integration 2.0.4, Spring 3.0.
>
> Cheers!
>
>

--
View this message in context: http://old.nabble.com/BTM%2BSpring%2BActiveMQ-%3A-Message-on-Queue-not-consumed-tp32580198p32586741.html
Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: BTM+Spring+ActiveMQ : Message on Queue not consumed

Kiwiland
Thank you so much for your response, I appreciate it. I did try the LRC and it worked fine, but it's probably not something we'd end up using in the long run. We may need to talk to multiple MQ servers, so LRC wouldn't work. May be, I'll start looking at other messaging servers :-)

 

Ludovic Orban-2 wrote
The problem certainly lies somwhere in ActiveMQ's code.

You may try tuning the Spring DefaultMessageListenerContainer (it caching
can confuse ActiveMQ a lot) and maybe disable BTM PoolingDataSource's
cacheProducersConsumers property as well.

Other than that, I can only recommend you to use a different JMS server with
a better working XA support, or to eventually try LRC.


2011/10/4 Kiwiland <karthik.nzx@gmail.com>

>
> Just an Update:
>
> While I'm still working on fixing this issue, I noticed that when I set
> both
> the minPoolSize and maxPoolSize to 1, the messages are being read off of
> the
> Queue nicely as expected. Any value of maxPoolSize > 1 is causing a
> problem.
> I tested it at least a dozen times just to make sure that my findings were
> accurate. Any thoughts on why this may be happening? Thanks.
>
> Cheers!
>
>
>
> Kiwiland wrote:
> >
> > Hi,
> >  I'm using PoolingConnectionFactory on ActiveMQ. I'm running into some
> > strange problems where the message on the queues are not getting
> consumed.
> > Say there are 10 queues and a message is moving from Queue 1 -> Queue 2
> > and so on. After some point say Queue3, the message is no longer getting
> > consumed. When I re-run the Junit test, the message gets picked up and
> > moves onto say Queue6 and then stops. I can't seem to figure out what's
> > going on. I did enable TRACE on the logs and looked quite a bit. I'd
> > really appreciate any thoughts. Thanks.
> >
> > When I tested with Spring's
> > org.springframework.jms.connection.CachingConnectionFactory, it seems to
> > work fine.
> >
> > My configuration:
> >       <bean id="connectionFactory"
> > class="bitronix.tm.resource.jms.PoolingConnectionFactory"
> > init-method="init" destroy-method="close">
> >               <property name="className"
> > value="org.apache.activemq.ActiveMQXAConnectionFactory" />
> >               <property name="uniqueName" value="activemq" />
> >               <property name="minPoolSize" value="1" />
> >               <property name="maxPoolSize" value="2" />
> >               <property name="allowLocalTransactions" value="false" />
> >               <property name="driverProperties">
> >                       <props>
> >                               <prop
> >
> key="brokerURL">${BROKER.URL}?jms.redeliveryPolicy.maximumRedeliveries=${JMS_REDELIVERIES_MAX:5}&jms.redeliveryPolicy.initialRedeliveryDelay=${JMS_REDELIVERIES_INITIAL_DELAY:1000}</prop>
> >                       </props>
> >               </property>
> >       </bean>
> >
> >
> > My Environment:
> > BTM 2.1.1, Spring Integration 2.0.4, Spring 3.0.
> >
> > Cheers!
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/BTM%2BSpring%2BActiveMQ-%3A-Message-on-Queue-not-consumed-tp32580198p32586741.html
> Sent from the Bitronix Transaction Manager mailing list archive at
> Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: BTM+Spring+ActiveMQ : Message on Queue not consumed

snicoll
For the record, we're quite happy with HornetQ.

On Fri, Oct 7, 2011 at 11:01 AM, Kiwiland <[hidden email]> wrote:

Thank you so much for your response, I appreciate it. I did try the LRC and
it worked fine, but it's probably not something we'd end up using in the
long run. We may need to talk to multiple MQ servers, so LRC wouldn't work.
May be, I'll start looking at other messaging servers :-)




Ludovic Orban-2 wrote:
>
> The problem certainly lies somwhere in ActiveMQ's code.
>
> You may try tuning the Spring DefaultMessageListenerContainer (it caching
> can confuse ActiveMQ a lot) and maybe disable BTM PoolingDataSource's
> cacheProducersConsumers property as well.
>
> Other than that, I can only recommend you to use a different JMS server
> with
> a better working XA support, or to eventually try LRC.
>
>
> 2011/10/4 Kiwiland <[hidden email]>
>
>>
>> Just an Update:
>>
>> While I'm still working on fixing this issue, I noticed that when I set
>> both
>> the minPoolSize and maxPoolSize to 1, the messages are being read off of
>> the
>> Queue nicely as expected. Any value of maxPoolSize > 1 is causing a
>> problem.
>> I tested it at least a dozen times just to make sure that my findings
>> were
>> accurate. Any thoughts on why this may be happening? Thanks.
>>
>> Cheers!
>>
>>
>>
>> Kiwiland wrote:
>> >
>> > Hi,
>> >  I'm using PoolingConnectionFactory on ActiveMQ. I'm running into some
>> > strange problems where the message on the queues are not getting
>> consumed.
>> > Say there are 10 queues and a message is moving from Queue 1 -> Queue 2
>> > and so on. After some point say Queue3, the message is no longer
>> getting
>> > consumed. When I re-run the Junit test, the message gets picked up and
>> > moves onto say Queue6 and then stops. I can't seem to figure out what's
>> > going on. I did enable TRACE on the logs and looked quite a bit. I'd
>> > really appreciate any thoughts. Thanks.
>> >
>> > When I tested with Spring's
>> > org.springframework.jms.connection.CachingConnectionFactory, it seems
>> to
>> > work fine.
>> >
>> > My configuration:
>> >       <bean id="connectionFactory"
>> > class="bitronix.tm.resource.jms.PoolingConnectionFactory"
>> > init-method="init" destroy-method="close">
>> >               <property name="className"
>> > value="org.apache.activemq.ActiveMQXAConnectionFactory" />
>> >               <property name="uniqueName" value="activemq" />
>> >               <property name="minPoolSize" value="1" />
>> >               <property name="maxPoolSize" value="2" />
>> >               <property name="allowLocalTransactions" value="false" />
>> >               <property name="driverProperties">
>> >                       <props>
>> >                               <prop
>> >
>> key="brokerURL">${BROKER.URL}?jms.redeliveryPolicy.maximumRedeliveries=${JMS_REDELIVERIES_MAX:5}&amp;jms.redeliveryPolicy.initialRedeliveryDelay=${JMS_REDELIVERIES_INITIAL_DELAY:1000}</prop>
>> >                       </props>
>> >               </property>
>> >       </bean>
>> >
>> >
>> > My Environment:
>> > BTM 2.1.1, Spring Integration 2.0.4, Spring 3.0.
>> >
>> > Cheers!
>> >
>> >
>>
>> --
>> View this message in context:
>> http://old.nabble.com/BTM%2BSpring%2BActiveMQ-%3A-Message-on-Queue-not-consumed-tp32580198p32586741.html
>> Sent from the Bitronix Transaction Manager mailing list archive at
>> Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>

--
View this message in context: http://old.nabble.com/BTM%2BSpring%2BActiveMQ-%3A-Message-on-Queue-not-consumed-tp32580198p32606276.html
Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email