You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by jguion <jg...@mitre.org> on 2011/04/28 16:09:23 UTC

Custom Message Filter

Hi,

I am trying to build a custom filter using the Spring DSL. I am able to
successfully  create it using the Java DSL using the .filter(new
CustomPredicate())  method where CustomPredicate is a class extending the
Predicate interface. However, I am not able to do this using the Spring DSL.
I have tried several things but I cannot get anything to filter my messages.

The path right now looks something like this:
 <from uri="vm:endpoint1" />
<process ref="processor1" />
<filter>
	<method ref="CustomPredicate" method="matches"/>			
</filter>
<process ref="processor2" />
<to ref="endpoint2" />

Any suggestions on how to implement this?

Thanks

--
View this message in context: http://camel.465427.n5.nabble.com/Custom-Message-Filter-tp4346578p4346578.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Custom Message Filter

Posted by Ashwin Karpe <ak...@fusesource.com>.
Hi,

Can you please post the complete bean.xml setup... It is unclear rom you
route definition whether you have even defined the CustomPredicate bean and
how you have done that..

Cheers,

Ashwin...

-----
---------------------------------------------------------
Ashwin Karpe
Apache Camel Committer & Sr Principal Consultant
FUSESource (a Progress Software Corporation subsidiary)
http://fusesource.com 

Blog: http://opensourceknowledge.blogspot.com 
CamelOne 2011: http://fusesource.com/camel2011 
---------------------------------------------------------
--
View this message in context: http://camel.465427.n5.nabble.com/Custom-Message-Filter-tp4346578p4346828.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Custom Message Filter

Posted by boday <be...@initekconsulting.com>.
make sure you put your <processor> ref inside the </filter> tag...

see 
http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringCustomPredicateTest.xml?view=markup
this example ...


jguion wrote:
> 
> Hi,
> 
> I am trying to build a custom filter using the Spring DSL. I am able to
> successfully  create it using the Java DSL using the .filter(new
> CustomPredicate())  method where CustomPredicate is a class extending the
> Predicate interface. However, I am not able to do this using the Spring
> DSL. I have tried several things but I cannot get anything to filter my
> messages.
> 
> The path right now looks something like this:
>  <from uri="vm:endpoint1" />
> <process ref="processor1" />
> <filter>
> 	<method ref="CustomPredicate" method="matches"/>			
> </filter>
> <process ref="processor2" />
> <to ref="endpoint2" />
> 
> Any suggestions on how to implement this?
> 
> Thanks
> 


-----
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: http://camel.465427.n5.nabble.com/Custom-Message-Filter-tp4346578p4346891.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Custom Message Filter

Posted by jguion <jg...@mitre.org>.
Oh I didn't catch that part. It works now, thank you!

--
View this message in context: http://camel.465427.n5.nabble.com/Custom-Message-Filter-tp4346578p4346937.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Custom Message Filter

Posted by Claus Ibsen <cl...@gmail.com>.
You need to put the stuff inside the filter tag

See the example here
http://camel.apache.org/message-filter

eg do

 <filter>
        <method ref="CustomPredicate" method="matches"/>
      <process ref="processor2" />
      <to ref="endpoint2" />
 </filter>



On Thu, Apr 28, 2011 at 4:09 PM, jguion <jg...@mitre.org> wrote:
> Hi,
>
> I am trying to build a custom filter using the Spring DSL. I am able to
> successfully  create it using the Java DSL using the .filter(new
> CustomPredicate())  method where CustomPredicate is a class extending the
> Predicate interface. However, I am not able to do this using the Spring DSL.
> I have tried several things but I cannot get anything to filter my messages.
>
> The path right now looks something like this:
>  <from uri="vm:endpoint1" />
> <process ref="processor1" />
> <filter>
>        <method ref="CustomPredicate" method="matches"/>
> </filter>
> <process ref="processor2" />
> <to ref="endpoint2" />
>
> Any suggestions on how to implement this?
>
> Thanks
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Custom-Message-Filter-tp4346578p4346578.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



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