On Mon, Feb 1, 2010 at 1:37 PM, Kevin Jackson <[email protected]> wrote: > 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 >
Hi Always remember to write version number used. I have looked into it and discovered a bug in the camel bean component. https://issues.apache.org/activemq/browse/CAMEL-2436 Will be fixed in the next 2.2 release. -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
