Hi,
I have a use case where I want to drop certain messages where the body
is null (or conversely I want to process messages where the body is
not null)
I have the following config
public static class ContextConfig extends RouteBuilder {
@Override
public void configure() {
from("direct:start").split(body(String.class).tokenize("\n"))
.bean(Unmarshaller.class).filter(
body().isNotNull())
.to("mock:result");
}
}
The Unmarshaller returns either a valid object or null, it is a POJO
and has no knowledge of Camel (and I want to keep it that way so I
don't want to change the code to inject a value into the header).
Reading the wiki and the posts in Nabble/MarkMail etc, I believe that
the filter() applied to the body is the correct approach, but in my
tests it seems as if the filter isn't being applied.
Kev