I am having a problem using the below code:

from("file:///file.txt").splitter(expression).convertBodyTo(String.class).to("file://result.txt")

This does not work, the reason being the convertBodyTo method of
ProcessorType class returns convertBodyTo[null] though I have set the value
to String.class. However the following works:

SplitterType splitter = from("file:///file.txt").splitter(expression);
splitter.addOutput(new ConvertBodyType("java.lang.String"));
splitter.to("file://result.txt");

Did anyone come across such problem? It would be nice if a
convertBodyTo(String) method is exposed in ProcessorType.

Thanks,
Lavanya.
-- 
View this message in context: 
http://www.nabble.com/Problems-with-convertBodyTo-in-Java-DSL-tp20182844s22882p20182844.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to