I have been trying for days now to get a message based router working in
ActiveMQ 5.1, and the only success I have had is with xpath.

Unfortunately, xpath will only work when the message body is xml ... which
often is not the case for me.

Here is an example of what does work (assuming the message body is xml):

    <route>
      <from uri="activemq:queue.dev.Tideworks.HelloWorld"/>
      <filter>
        <xpath>$JMSType = 'Tideworks.GateVision.OCR.Lane'</xpath>
        <to uri="activemq:queue.dev.Tideworks.HelloWorld"/>
      </filter>
    </route>

So ... once I realized this only works with fully xml message bodies, I
tried all of the following, with no luck  ...

  <route>
    <from uri="activemq:queue.dev.Tideworks.HelloWorld"/>
    <filter>
        <simple>property.JMSType = 'Tideworks.GateVision.OCR.Lane'</simple>
        <to uri="activemq:queue.dev.Tideworks.HelloWorld.it_works"/>
    </filter>
  </route>

  <route>
    <from uri="activemq:queue.dev.Tideworks.HelloWorld"/>
    <filter>
        <el>in.headers.jmstype startswith 'Tideworks'</el>
        <to uri="activemq:queue.dev.Tideworks.HelloWorld.it_works"/>
    </filter>
  </route>

All of the above configurations will load and run without throwing
exceptions, but only the xpath example will do what I want.  And again, I
need to be able to operate with non-xml messages.

In the ideal world, I would use a filter that allows me to use the same
style JMS selector expressions that a developer would be accustomed to using
when configuring a MessageDrivenBean.

I must be missing something very obvious here ....

Configuration:

ActiveMQ 5.1
Camel 1.2 (and also tried 1.3)
Redhat and Windows XP

Camel libraries included in the activemq/lib directory .....

../lib/camel-core-1.2.0.jar    ../lib/camel-jms-1.2.0.jar   
../lib/camel-juel-1.2.0.jar   ../lib/camel-spring-1.2.0.jar
../lib/camel-groovy-1.2.0.jar  ../lib/camel-josql-1.2.0.jar 
../lib/camel-saxon-1.2.0.jar



-- 
View this message in context: 
http://www.nabble.com/How-do-I-get-a-Content-Based-Router-configured-in-XML-with-ActiveMQ--tp15339501s22882p15339501.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to