camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: DSL Content Router interrupted with splitter() or multicast()
Date Thu, 05 Mar 2009 09:51:47 GMT
On Thu, Mar 5, 2009 at 10:25 AM, ee7arh <andrew.hurst@2e-systems.com> wrote:
>
> Hi,
>
> When I tryto use the functions "splitter()" or "multicast()" in my DSL
> within a "choice()" block, I am not able to have another "when()" or even an
> "otherwise()"
>
> Predicate isInvitation
>        = PredicateBuilder.regex(header("event_type"), "invitation");
>
> Predicate isReply
>        = PredicateBuilder.regex(header("event_type"), "reply");
>
> from("jms:queue:myQueue")
> .choice()
>    .when(isInvitation)
>        .to("bean:eventMarshaller?methodName=unmarshallTriggerInvites")
>        .splitter(body()) // This line causes a compilcation problem on the
> next when() or otherwise()
>        .to("jms:queue:unmarshalledEventsQueue"))
>    .when(isFlightUpdate)
>
> If I take out the splitter() line above, all works fine and I can have as
> many when() statements as I like. Is there a reason why this doesn't work?
Yeah the compiler can not follow you :) When you mix like that in some
situations you get to a hold.

The solution is to split your route in sub routes. So keep one route
for the overall choice
And then sub routes for the splitter

You can use "direct:xxx" endpoints to connect them in sync fashion
and use "seda:xxx" for async fashion.


>
> Thanks
> Andrew
>
>
> --
> View this message in context: http://www.nabble.com/DSL-Content-Router-interrupted-with-splitter%28%29-or-multicast%28%29-tp22347983p22347983.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/

Mime
View raw message