Hi All:
I have following codes:
intercept().process(new Processor() {
public void process(Exchange
exchange) throws Exception {
System.out.println("Intercept without condition");
}
}).when(simple("${in.body} ==
'a'")).process(new Processor() {
public void process(Exchange
exchange) throws Exception {
System.out.println("Intercept when body equals 'a'");
}
});
from("timer:foo?repeatCount=1").setBody(constant("b")).process(
new Processor() {
public void
process(Exchange exchange)
throws Exception {
System.out.println(exchange.getIn().getBody(
String.class));
}
});
The result is:
Intercept without condition
Intercept when body equals 'a'
Intercept without condition
Intercept when body equals 'a'
b
But I think the correct one should be:
Intercept without condition
Intercept without condition
b
and if I move the when condition to next behind the intercept(), then it
works fine.
Does anybody can have a look, and check it's a Camel bug or not?
Thanks
GangLiu