The "poll  value of startCoreRoutes every x seconds" bit can be done easily
with a CountdownLatch.
http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/CountDownLatch.html

Have your other routes block on that and then trigger it when your Route A
is complete.
Obviously do nice things to handle things like shutting down the camel
context if the routes are blocked.

On 21 September 2012 17:30, Edwin <edwin.rabbi...@gmail.com> wrote:

> Thanks for your reply Willem,
>
> Apologies if I wasn't clear before. I have 6 routes in my application.
> Route
> A, B, C, D, E, F
>
> Before I start routes (B-F).  Route A needs to complete any work assigned
> to
> it. Route A in this instance takes messages from a JMS queue and places
> them
> into a database. I need Route A to move all of the messages from the JMS
> queue and insert them into the database before I can start Routes (B-F)
>
> I came up with a potential solution, would be interested to see what folks
> thought about it
>
> Let's say:
>
> boolean startCoreRoutes = false
>
> from(dbJmsQueue).to(database).onComplete().onWhen(interogate the exchange
> to
> determine there are no more messages coming from the queue =
> true).process(inline processor - startCoreRoutes = true)
>
> // poll the value of startCoreRoutes every x seconds
> if (startCoreRoutes){
>     buildCoreRoutes();
> }
>
> void buildCoreRoutes() {
> // build core routes
> }
>
> Any insights are much appreciated.
>
> Thanks,
> Edwin
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Starting-route-s-upon-completion-of-another-route-tp5719681p5719730.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
-Sam

Reply via email to