camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Howe <>
Subject Handling namespaces with content based routing using camel-activemq.
Date Wed, 16 Mar 2011 16:35:24 GMT
Hi, first post here!

We have an instance of apache-activemq running which includes camel.

We are sending some messages to a queue called 'in' that look like this:

<?xml version="1.0" encoding="utf-8"?>
<mp:command xmlns:mp="http://www.blah/blah"  name="submit" >


<?xml version="1.0" encoding="utf-8"?>
<mp:event xmlns:mp="http://www.blah/blah"  name="status" >

We need to route the messages based on their root element name and content
of @name
so the above messages need to go to the endpoints called commands.submit and

I created the following route to test the @name based matching:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<route autoStartup="true" inheritErrorHandler="true" id="generalin"
xmlns:ns2="" xmlns="">
    <from uri="activemq:in"/>
    <choice inheritErrorHandler="true" id="choice1">
        <when inheritErrorHandler="true">
            <to uri="activemq:commands.submit" inheritErrorHandler="true"
        <otherwise inheritErrorHandler="true">
            <to uri="activemq:lostandfound" inheritErrorHandler="true"

This route works fine. It routes any messages where name contains 'submit'
to the right endpoint.

I then tried to modify the route so that it matched <mp:command>. I tried
changing the xpath to


and neither worked. Also the message did not get routed to anywhere -ie it
didnt go to lostandfound.

I also tried adding xmlns:mp="http://www.blah/blah"  to the <route> part of
the route definition but it was removed when I saved the route.

Any advice appreciated.

Thanks, Tom

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message