Hi,

I believe you are going about this completely wrong.

What you need is to set up an EventManager object/entity that can keep an
eye on ActiveMQ using Advisory queues/topics or JMX to figure out the queues
and whether there are messages on these queues/topics. 

The this EventManager needs to be able to perform route lifecycle operations
(aka start, stop, suspend & resume routes) as and when queues and topics
contain messages or are drained.

Obviously, this solution becomes rather expensive and ineffective if the
drained queues fill up after very short waits since the Event Manager will
spend a most of its time starting and stopping routes for little value.

If you have a reference to the camel context, starting, stopping, suspending
and resuming routes is all simple and API driven.

Note that when you stop routes, you must take care to ensure that there are
no exchanges being processed by the route at the time. There is a graceful
shutdown on routes so please use this...

Hope this helps.

Cheers,

Ashwin...

-----
---------------------------------------------------------
Ashwin Karpe
Apache Camel Committer & Sr Principal Consultant
FUSESource (a Progress Software Corporation subsidiary)
http://fusesource.com 

Blog: http://opensourceknowledge.blogspot.com 
---------------------------------------------------------
--
View this message in context: 
http://camel.465427.n5.nabble.com/Activemq-dynamic-endpoint-configuration-tp4749853p4758889.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to