>> Step 2 implies that the message coming on Q2 needs to be inspected and
only if it turns out to be M2.....

I think the Content-Based Router EIP is a good fit here,
http://camel.apache.org/content-based-router.html. For example:

from("jms:q2")
    .choice().when(body().isInstanceOf(M2.class))
         .to("controlbus:routeId=Route1&action=start")
    .end()

>> Is there something we can do to pause a Route while it waits for a
message and resume it once the message arrives?

If a route is paused it cannot do anything, its paused after all. You'll
need another route or process to resume a route. Pausing/resuming routes
can be done using the CamelContext (
http://camel.apache.org/how-can-i-stop-a-route-from-a-route.html) or using
the ControlBus EIP (http://camel.apache.org/controlbus.html). The latter is
easier to use, as illustrated in the code sample above.

>> Can we raise an event so that any Route that is waiting for M2 can be
resumed?
>> What do we need to do to resume the route?

Use the CamelContext API directly or use the ControlBus EIP as I mentioned

Regards,
Richard



On Tue, Dec 31, 2013 at 5:56 PM, yashgt <yas...@gmail.com> wrote:

> Hi,
>
> Route1:
>         Send Message M1 to MQ Q1. // This message goes to a program that
> consumes
> from Q1 and once some processing is done, write message M2 to Q2.
>         Upon receiving Message M2 on Q2, //Q2 receives several messages
> (M2,N2,P2,
> etc.). ONLY when M2 is received, the Route1 should continue.
>         Send message M3 to Q3. // The step should be executed only
>
> Step 2 implies that the message coming on Q2 needs to be inspected and only
> if it turns out to be M2, the Route1 should resume. Is there something we
> can do to pause a Route while it waits for a message and resume it once the
> message arrives?
> Can we raise an event so that any Route that is waiting for M2 can be
> resumed? We know for sure that among all the parallely executing routes,
> only one may wait for M2. What do we need to do to resume the route?
>
> Thanks,
> Yash
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Asynchronous-processing-of-routes-tp5745385.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Reply via email to