camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jason.parr" <jason.p...@usa.net>
Subject Enforcing a single thread of execution across all routes
Date Thu, 10 Nov 2011 09:43:39 GMT
I have two routes reading from two difference jms queues both of which are on
the same jms broker. Whilst a message is being processed on one route I want
the other route to block.  I set the jms config so only had one concurrent
jms consumers but this was reading messages and giving them to camel which
was then threading.

 <bean id="jmsConfig"
class="org.apache.camel.component.jms.JmsConfiguration">
    <property name="connectionFactory" ref="jmsPooledConnectionFactory"/>
    <property name="transacted" value="true"/>
    <property name="concurrentConsumers" value="1"/>
  </bean>

What's the easiest way to acheive this in camel?

1) Configure camel in some way to be single threaded ( how is this done?)
2) Explicit lock bean using java's concurrent package, but then have to put
call on all routes.
3) I could merge messages from the two jms routes queues onto a single camel
route but then would have split again using choice which seems a long winded
way round the problem.


--
View this message in context: http://camel.465427.n5.nabble.com/Enforcing-a-single-thread-of-execution-across-all-routes-tp4980536p4980536.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message