Hello people.
Please help me, i try to use choice after a split, tokenize and stream a
file.
But the code never goes to .choice, when i use body(File.class) to
split/tokenize.
If i use body(String.class) goes, but put all file in memory.

public class RoteadorVisa extends RouteBuilder {
        @Override
        public void configure() throws Exception {
                
from("file:///tmp/files/?recursive=true&autoCreate=true&noop=true")
                //This runs ok. If i put body(String.class) instead of 
body(File.class)
                .split(body(File.class).tokenize("\n")).streaming()
                .process(new Processor(){
                        public void process(Exchange exchange) throws Exception 
{
                                System.out.println(exchange.getIn().getBody());
                        }
                })
                //NEVER GOES HERE
                .choice()
                .when( body(String.class).isNotNull() )
                        .process(new Processor(){
                                public void process(Exchange exchange) throws 
Exception {
                                        
System.out.println(exchange.getIn().getBody());
                                }
                        })
                .otherwise()
                        .process(new Processor(){
                                public void process(Exchange exchange) throws 
Exception {
                                        
System.out.println(exchange.getIn().getBody());
                                }
                        })
                .end();
        }
}
-- 
View this message in context: 
http://www.nabble.com/split-%2B-stream-%2B-choice%2C-what-wrong--tp23689175p23689175.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to