You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Glenn Macgregor <gm...@pocketkings.ie> on 2009/03/06 12:32:19 UTC
Camel and spring XML
Hi All,
I have installed activemq 5.2.0 and see that a minimal set of camel functionality is included, activemq-camel.jar, camel-core, camel-jetty, camel-jms and camel-spring. I have added a route in my activemq.xml config file:
<route>
<from uri="activemq:topic:el1"/>
<to uri="activemq:topic:test1"/>
</route>
This route works fine, I get the message in the el1 topic listener and the test1 topic listener.
When I add a filter to the route:
<route>
<from uri="activemq:topic:el1"/>
<filter>
<simple>header.testto = "test1"</simple>
<to uri="activemq:topic:test1"/>
</filter>
</route>
I do not get the message in the test1 topic listener.
Is this EIP included in the default camel jars in activemq or do I need to install the camel disto?
Also is there a way to set the uri attribute of the from and to elements using JMS message variables like header.testto?
Thanks
Glenn
Re: Camel and spring XML
Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Mar 6, 2009 at 12:32 PM, Glenn Macgregor
<gm...@pocketkings.ie> wrote:
> Hi All,
>
> I have installed activemq 5.2.0 and see that a minimal set of camel functionality is included, activemq-camel.jar, camel-core, camel-jetty, camel-jms and camel-spring. I have added a route in my activemq.xml config file:
>
> <route>
> <from uri="activemq:topic:el1"/>
> <to uri="activemq:topic:test1"/>
> </route>
>
> This route works fine, I get the message in the el1 topic listener and the test1 topic listener.
>
> When I add a filter to the route:
>
> <route>
> <from uri="activemq:topic:el1"/>
> <filter>
> <simple>header.testto = "test1"</simple>
> <to uri="activemq:topic:test1"/>
> </filter>
> </route>
>
> I do not get the message in the test1 topic listener.
>
> Is this EIP included in the default camel jars in activemq or do I need to install the camel disto?
Yes all EIP is included in camel-core.
The simple language DOES not support operators in Camel 1.x. This is a
new feature in Camel 2.0
So you can only test if there is a header or not in Camel 1.x
You can use xpath instead
<xpath>$testto = 'test1'</xpath>
where $testto will refer to the header with that name. Its a special
function added to xpath by Camel.
See more here
http://camel.apache.org/message-filter.html
>
> Also is there a way to set the uri attribute of the from and to elements using JMS message variables like header.testto?
Do you mean something like the recipient list EIP?
http://camel.apache.org/recipient-list.html
>
> Thanks
>
> Glenn
>
>
--
Claus Ibsen
Apache Camel Committer
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/