You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Tim Dudgeon <td...@gmail.com> on 2015/06/18 19:27:29 UTC

routing slip with InOut pattern

Is is possible to use routing slip so that it always waits for response?
For instance if the routing slip specifies a seda route then it seems to 
execute asynchronously and the routing slip returns immediately.
If instead I route to a direct endpoint it waits as desired, but that 
direct route is blocked and won't take any more messages until complete.
For example:

from("seda:start")
   .routingSlip(header("someHeader")
   .log("routing finished");

from("direct:routeA")
    .delay(5000)
   .log("hello from route A");

from("seda:routeB")
   .delay(5000)
   .log("hello from route B");


I want to send message to seda:start with routing slip header that 
specifies seda:routeB but I want to see "hello from route B" before I 
see "routing finished".

Thanks
Tim

Re: routing slip with InOut pattern

Posted by Claus Ibsen <cl...@gmail.com>.
Make sure the MEP is InOut before sending to the seda endpoint then it
does a request-reply messaging.

http://camel.apache.org/request-reply.html

On Thu, Jun 18, 2015 at 7:27 PM, Tim Dudgeon <td...@gmail.com> wrote:
> Is is possible to use routing slip so that it always waits for response?
> For instance if the routing slip specifies a seda route then it seems to
> execute asynchronously and the routing slip returns immediately.
> If instead I route to a direct endpoint it waits as desired, but that direct
> route is blocked and won't take any more messages until complete.
> For example:
>
> from("seda:start")
>   .routingSlip(header("someHeader")
>   .log("routing finished");
>
> from("direct:routeA")
>    .delay(5000)
>   .log("hello from route A");
>
> from("seda:routeB")
>   .delay(5000)
>   .log("hello from route B");
>
>
> I want to send message to seda:start with routing slip header that specifies
> seda:routeB but I want to see "hello from route B" before I see "routing
> finished".
>
> Thanks
> Tim



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/