I'm trying to migrate to ActiverMQ 5.11 using the new dynamic routing option.

Using 5.10 I was able to place a name space in an external camel file such
as:

<camelContext id="esbRoutes" trace="false" streamCache="true"
xmlns="http://camel.apache.org/schema/spring";
xmlns:km="http://xsdrepo.foundationmedicine.com/messaging/esb";>
        <route id="esbRoute1" errorHandlerRef="myDeadLetterErrorHandler">
            <from uri="activemq:queue:esb.*"/>
            <wireTap uri="activemq:queue:wire.tapped"/>
            <doTry>
                <to
uri="validator:http://xsdrepo.foundationmedicine.com/messaging/esb/ESBMessageV3.xsd"/>
                <setHeader headerName="Route1">
                    <xpath
resultType="String">/km:FMIMessage/km:Header/km:Route/text()</xpath>
                </setHeader>
                <recipientList delimiter="false">
                    <header>Route1</header>
                </recipientList>
                <doCatch>
                   
<exception>org.apache.camel.ValidationException</exception>
                    <onWhen>
                        <simple>${exception.message}</simple>
                    </onWhen>
                    <to uri="activemq:queue:invalid.schema"/>
                </doCatch>
            </doTry>
        </route>
</camelContext>

If I try doing the same in the new ActiveMQ 5.11 routes.xml it fails on the
namespace km :

*Error*

Reason: javax.xml.xpath.XPathExpressionException:
com.sun.org.apache.xpath.internal.domapi.XPathStylesheetDOM3Exception:
Prefix must resolve to a namespace: km]
org.apache.camel.builder.xml.InvalidXPathExpression: Invalid xpath:
/km:FMIMessage/km:Header/km:Route/text(). Reason:
javax.xml.xpath.XPathExpressionException:
com.sun.org.apache.xpath.internal.domapi
.XPathStylesheetDOM3Exception: Prefix must resolve to a namespace: km

*Source :*

<routes id="esbRoutes" 
        xmlns="http://camel.apache.org/schema/spring";   
        xmlns:km="http://xsdrepo.foundationmedicine.com/messaging/esb";>

        <route id="esbRoute1" >
                <from uri="broker:queue:esb.*"/>
                <wireTap uri="broker:queue:wire.tapped"/>
                <doTry>
                        <to
uri="validator:http://xsdrepo.foundationmedicine.com/messaging/esb/ESBMessageV3.xsd"/>
                        <setHeader headerName="Route1">
                                <xpath
resultType="String">/km:FMIMessage/km:Header/km:Route/text()</xpath>
                        </setHeader>
                        <recipientList delimiter="false">
                                <header>Route1</header>
                        </recipientList>
                        <doCatch>
                                
<exception>org.apache.camel.ValidationException</exception>
                                <onWhen>
                                        <simple>${exception.message}</simple>
                                </onWhen>
                                <to uri="broker:queue:invalid.schema"/>
                        </doCatch>
                </doTry>
        </route>
</routes>

Thanks

Mike



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/ActiveMQ-5-11-Dynamic-Camel-Route-Message-Namespaces-tp4693314.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to