camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jesse Sanford <>
Subject need help with interceptor in camel 1.6.2 using custom predicate
Date Sun, 11 Apr 2010 21:11:30 GMT
I am trying to intercept an exchange using a custom predicate and I am
having trouble re-routing the exchange or even simply stoping it.

Here is my routebuilder:

public class commentRoute extends RouteBuilder{
    public void configure(){

    private Predicate isBlacklisted(){
        return new Predicate(){
            public boolean matches(Object ex) {
                Exchange exchange = (Exchange)ex;
                String email =
                if(email.equalsIgnoreCase("")) {
                    return true;
                } else {
                    return false;

            public void assertMatches(String s, Object o) {
                //do nothing
                //this just satisfies the interface


I know that the predicate is being run because If I set a breakpoint at

if(email.equalsIgnoreCase("")) {

and step through the code from there the return true; is reached when i send
an exchange with the email address filled in with my email address.

Am I doing this all wrong? If this predicate is run and returns true why
doesn't camel respect my intercept re-routing or stoping?

Thanks so much,

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message