Iam trying to write a camel route which would send different elements of a
list to different queues.

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?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Splitting-list-of-elements-in-a-message-body-tp5750556.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to