On Tue, May 20, 2008 at 9:07 PM, rmunjuluri <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I am trying out simple content based routing of the following messages:
>
> <Person>
>        <FirstName>John</FirstName>
>        <LastName>Smith</LastName>
>        <Destination>A</Destination>
> </Person>
>
> <Person>
>        <FirstName>John</FirstName>
>        <LastName>Smith</LastName>
>        <Destination>B</Destination>
> </Person>
>
> I would like for the first message (Destination=A) to go to a JMSQueue
> (Camel.A) in JBoss and the second message (Destination=B) to go to a
> JMSQueue (Camel.B) in JBoss. I have the endpoints configured but when I send
> these two messages to a CamelContext
> ==============================
> <camelContext id="ContentBasedRouter"
> xmlns="http://activemq.apache.org/camel/schema/spring";>
>      <route>
>        <from
> uri="jbi:endpoint:http://consumers.pictor.com//CamelContentBasedRouterService/CamelContentBasedRouterEndpoint"/>
>        <choice>
>          <when>
>            <xpath>/Person/Destination='A'</xpath>
>            <to
> uri="jbi:service:http://services.pictor.com//CamelAJMSProvider"/>
>          </when>
>          <when>
>            <xpath>/Person/Destination='B'</xpath>
>            <to
> uri="jbi:service:http://services.pictor.com//CamelBJMSProvider"/>
>          </when>
>        </choice>
>      </route>
>  </camelContext>
> ==============================
> this is the exception I get
> INFO  - LogTask                        - Logging system reconfigured using
> file: file:conf/log4j.xml
> [Fatal Error] :-1:-1: Premature end of file.
> ERROR - DeadLetterChannel              - Failed delivery for exchangeId:
> ID-enterprise/4930-1211338934640/0-0.
>  On delivery attempt: 0 caught: org.apache.camel.RuntimeCamelException:
> org.xml.sax.SAXParseException: Prematu
> re end of file.
> org.apache.camel.RuntimeCamelException: org.xml.sax.SAXParseException:
> Premature end of file.
>        at
> org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:326)
>        at
> org.apache.camel.impl.converter.InstanceMethodTypeConverter.convertTo(InstanceMethodTypeConverter.j
> ava:50)
>        at
> org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:64)
>        at
> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:52)
>        at
> org.apache.camel.builder.xml.XPathBuilder.getDocument(XPathBuilder.java:537)
>
> Is there something wrong with my camel-context.xml ?

I'm not exactly sure about the error, but the XPath queries are not
valid. If you want to look at the text in the Destination element, the
following is a valid XPath query to grab that text:

/Person/Destination/text() = 'A'

Give that a try.

Bruce
-- 
perl -e 'print unpack("u30","D0G)[EMAIL 
PROTECTED]&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/

Blog: http://bruceblog.org/

Reply via email to