Reputation: 75
Maybe this is a very dumb question but It will help to clarify my understanding of camel. I have a seda queue where I insert objects of type FromData. FromData has a method
public GenericFile<File> getFirstFile () {
return files.values().iterator().next();
}
Now in my route I want read from the queue and split the contents of the file.
I came up with this solution. Are there a better way to refer to body.firstFile
, other ways of doing .split(simple("${body.firstFile}"))
public void configure() {
from("seda:processReceiver")
.split(simple("${body.firstFile}"))
.split(body().tokenize(",")).streaming()
.process(new Processor() {
public void process(Exchange msg) {
System.out.println(msg.getIn().getBody());
}
});
}
Upvotes: 1
Views: 536