My new route with the fix is 

.choice()
                        .when().simple("${in.body} contains 'vessel'") 
                                .unmarshal(getJaxbDataFormat())
                        .otherwise()
                                .process(new Processor() {
                                        
                                        @Override
                                        public void process(Exchange exchange) 
throws Exception {
                                                List<VesselVisitor> body = new 
ArrayList<VesselVisitor>();
                                                body.add(null);
                                                
exchange.getOut().setBody(body);                                                
                                        }
                                })
                .endChoice()


I know this is not performant, but It's a solution 



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-return-null-element-with-Camel-CXF-tp5747194p5747196.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to