0
votes

I'm new to Apache Camel and I'm starting to learn it.

I have a problem with the following route:

   from()  
            .unmarshal()    
                    .filter().javaScript()    
                            .setHeader()          
                            .convertBodyTo()  
                            .to();

When I run it, the filter() gets applied; if filter() returns true, everything is ok; if filter() returns false, the setHeader() and convertTo() steps are bypassed but the to() step is not.

I'm using Camel 2.11.1 in a Java SE application.

Regards, Alessandro

1
I can't reproduce your case. Filter works fine with my routes. Maybe you should try removing some elements of your route and adding logging messages (.log() or .to("log:loggerpackage")) to see which one is responsible for that. You can try using choice() too if filter is wrong.zenbeni
This question is also posted on Camel mailing list!Claus Ibsen
@ClausIbsen: yes, I did it...Alessandro Baldoni

1 Answers

0
votes

The problem was with the from() producer. After enabling all the tracing options as in http://camel.apache.org/tracer.html, I was able to understand what was going on.

The actual code for the producer is:

from("mina2:udp://<ip address>:514")

Somehow, with both mina and mina2, the source message is "echoed" back between a random port and port 514.

Using Netty everything works as expected.