Redelivery with multiple transacted routes

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

Re: Redelivery with multiple transacted routes

kafe
This post was updated on .
@anoordover : unfortunately, i can not run my application with Camel 2.7.5 but i'll try as soon as possible with this version.


BTW, i set ActiveMQ logs into DEBUG and i see something strange (maybe it is not) :

2012-01-20 11:56:50,476 | DEBUG | queue://traiterReponse remove sub: QueueSubscription: consumer=ID:pc-dev-49-48540-1327056659376-0:6:2:217, destinations=1, dispatched=0, delivered=0, pending=0, lastDeliveredSeqId: 0, dequeues: 1, dispatched: 1, inflight: 0 | org.apache.activemq.broker.region.Queue | ActiveMQ Transport: tcp:///127.0.0.1:44072
2012-01-20 11:56:50,476 | DEBUG | localhost adding consumer: ID:pc-dev-49-48540-1327056659376-0:3:1:219 for destination: queue://traiterReponse | org.apache.activemq.broker.region.AbstractRegion | ActiveMQ Transport: tcp:///127.0.0.1:44069
2012-01-20 11:56:50,478 | DEBUG | queue://traiterReponse add sub: QueueSubscription: consumer=ID:pc-dev-49-48540-1327056659376-0:3:1:219, destinations=0, dispatched=0, delivered=0, pending=0, dequeues: 1, dispatched: 1, inflight: 0 | org.apache.activemq.broker.region.Queue | ActiveMQ Transport: tcp:///127.0.0.1:44069


2012-01-20 11:56:51,480 | DEBUG | queue://traiterReponse remove sub: QueueSubscription: consumer=ID:pc-dev-49-48540-1327056659376-0:3:1:219, destinations=1, dispatched=0, delivered=0, pending=0, lastDeliveredSeqId: 0, dequeues: 1, dispatched: 1, inflight: 0 | org.apache.activemq.broker.region.Queue | ActiveMQ Transport: tcp:///127.0.0.1:44069
2012-01-20 11:56:51,480 | DEBUG | localhost adding consumer: ID:pc-dev-49-48540-1327056659376-0:8:2:77 for destination: queue://traiterReponse | org.apache.activemq.broker.region.AbstractRegion | ActiveMQ Transport: tcp:///127.0.0.1:44074
2012-01-20 11:56:51,482 | DEBUG | queue://traiterReponse add sub: QueueSubscription: consumer=ID:pc-dev-49-48540-1327056659376-0:8:2:77, destinations=0, dispatched=0, delivered=0, pending=0, dequeues: 1, dispatched: 1, inflight: 0 | org.apache.activemq.broker.region.Queue | ActiveMQ Transport: tcp:///127.0.0.1:44074


Every second, this message happens for all queues managed in my application.
Isn't it a potential problem ?
Reply | Threaded
Open this post in threaded view
|

Re: Redelivery with multiple transacted routes

kafe
Hum... I finally succeed in having a correct amq redelivery. And the problem was seemingly due to the logs of my previous post.

I found a post speaking of CACHE_CONSUMER and by adding the fowwing property to my jmscomponent <property name="cacheLevelName" value="CACHE_CONSUMER" /> i finally had the expected behaviour (and by the way the end of the infinite remove sub/add sub) :-)

I'm going now to see what exactly does this option.

Thanks all for your help.
Reply | Threaded
Open this post in threaded view
|

Re: Redelivery with multiple transacted routes

Babak Vahdat
Nice to hear that it works now, also [1] explains the meaning of all those CACHE_XXX int constants which camel-jms makes use of.

[1] http://static.springsource.org/spring/docs/3.0.x/api/org/springframework/jms/listener/DefaultMessageListenerContainer.html

Babak
Reply | Threaded
Open this post in threaded view
|

Re: Redelivery with multiple transacted routes

anoordover
In reply to this post by anoordover
About the cache level:
see:
http://camel.apache.org/jms.html

Transactions and Cache Levels

If you are consuming messages and using transactions (transacted=true) then the default settings for cache level can impact performance.
If you are using XA transactions then you cannot cache as it can cause the XA transaction not to work properly.
If you are not using XA, then you should consider caching as it speedup performance, such as setting cacheLevelName=CACHE_CONSUMER.
Through Camel 2.7.x, the default setting for cacheLevelName is CACHE_CONSUMER. You will need to explicitly set cacheLevelName=CACHE_NONE.
In Camel 2.8 onwards, the default setting for cacheLevelName is CACHE_AUTO. This default auto detects the mode and sets the cache level accordingly to:
CACHE_CONSUMER = if transacted=false
CACHE_NONE = if transacted=true
So you can say the default setting is conservative. Consider using cacheLevelName=CACHE_CONSUMER if you are using non-XA transactions.


This explains why 2.7.x is different from 2.8 onwards.
Reply | Threaded
Open this post in threaded view
|

Re: Redelivery with multiple transacted routes

kafe
Thank you for these precisions.
12