camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Matèrne (jhm) <apa...@materne.de>
Subject AW: Splitting list of elements in a message body..
Date Thu, 24 Apr 2014 19:57:59 GMT
> The message body would be a list with 2 xml's. For example:
> 
>     <Cat>
>     <Name>Cat1</Name>
>     </Cat>,
>     <Dog>
>     <Name>Dog1</Name>
>     </Dog>
> 
> Now, I need to send the 'Cat' part of the message i.e.
> <Cat><Name>Cat1</Name></Cat> part to queue1 and the 'Dog' part
of xml
> i.e.
> <Dog><Name>Dog1</Name></Dog> to a different queue?
> 
> This is the route that I have, but is not working:
> 
>     <route>
>         <from uri="jms:queue:InQueue" />
>         <choice>
>             <when>
>                 <simple>${in.body} regex 'Cat'</simple>
>                 <to uri="jms:queue:CatQueue" />
>             </when>
>             <when>
>                 <simple>${in.body} regex 'Dog'</simple>
>                 <to uri="jms:queue:DogQueue" />
>             </when>
>         </choice>
>     </route>
> 
> Any ideas on what am i doing wrong here?


First you have to split the message (is there a comma between </Cat> and
<Dog>?)

Jan



Mime
View raw message