camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edwin <edwin.rabbi...@gmail.com>
Subject Re: Starting route(s) upon completion of another route
Date Fri, 21 Sep 2012 16:30:26 GMT
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.

Mime
View raw message