On Sun, Sep 6, 2009 at 1:36 PM, sailaja p<[email protected]> wrote:
>
>
> Hi All,
>
> I am using Camel1.5 version. I am trying to use a splitter inside the
> Contest Based Router pattern. Below is my Java DSL route.
>
>
> from("jms:queue:test").choice().when().xpath("/book/name").splitter().xpath("/book/price").to("jms:queue:PriceQ").to("direct:BookName").otherwise().to("jms:topic:Invalid");
>
> Whenever I add the splitter after the when processor, I am getting error at
> Otherwise pattern.
>
> Is the way I am coding the route is right?
>
Yeah you need to denote the end of the splitted route so add .end()
from("jms:queue:test").choice().when().xpath("/book/name").splitter().xpath("/book/price").to("jms:queue:PriceQ").to("direct:BookName").end().otherwise().to("jms:topic:Invalid");
However its often more easily to use multiple route and use
"direct:xxx" to link from one route to the other, such as:
from("jms:queue:test").choice().when().xpath("/book/name").to("direct:splitme").otherwise().to(....);
from("direct:splitme").splitter()....
> If not, please suggest me the right path.
>
> Thanks,
> Sailaja.
> --
> View this message in context:
> http://www.nabble.com/Using-Splitter-in-CBR-tp25316850p25316850.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/
Twitter: http://twitter.com/davsclaus