camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Custom Predicates definition in Spring XML
Date Tue, 09 Nov 2010 07:21:43 GMT
On Tue, Nov 9, 2010 at 12:50 AM, rxm0203 <rah_mehta@yahoo.com> wrote:
>
> I am using following XML snippet to declare custom predicate on my route.
> However, Camel 2.4 is throwing exception. It looks like Camel is not able to
> find Bean from exception message. Is it a correct syntax for custom
> predicate declaration?
>
> <bean id="filterPredicate" class="test.MockPredicate"/> <camelContext
> id="camel" xmlns="http://camel.apache.org/schema/spring"> <route> <from
> uri="activemq:queueA"/> <filter> <method ref="filterPredicate"/> <to
> uri="activemq:queueB"/> <filter> </route> </camelContext>
>
> If it is incorrect, what is correct syntax?
>

Looks like it yeah. What exception do you get?


> Can I make route transactional with following syntax?
>
> <bean id="filterPredicate" class="test.MockPredicate"/> <camelContext
> id="camel" xmlns="http://camel.apache.org/schema/spring"> <route> <from
> uri="activemq:queueA"/> <transacted/><filter> <method
> ref="filterPredicate"/> <to uri="activemq:queueB"/> <filter> </route>
> </camelContext>
>

Yes just add <transacted/> to the route. And also since you use
JMS/ActiveMQ you need to enable transacted=true on the JMS connection
factory.

There is a free excerpt of the Camel book chapter 9 here, which covers
transactions with Camel
http://fusesource.com/fuse/apache-books/


> Thanks,
>
> Ray
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Custom-Predicates-definition-in-Spring-XML-tp3256012p3256012.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Mime
View raw message