I am using Apache camel and spring boot for one application. I need to read from a directory and then unmarshal the xml read and then process the unmarshalled object to set some more data in it and then to marshal it again and to send it to a different folder. I am using the following route. Please tell me how to send the POJO after unmarshalling to the processor. Presently it is by default the exchange going into the processor.
@SpringBootApplication
public class CamelApplication extends FatJarRouter {
public static void main(String ... args) {
SpringApplication.run(CamelApplication.class, args);
}
@Override
public void configure() throws Exception {
from("file:input?noop=true")
.log("Read from the input file")
.unmarshal(new XMLtoPOJO())
.log("Unmarshalled the xml")
.process(new MyProcessortoSetMoreDatatoPOJO())
.log("Enriched with more data in processor")
.to("file:destination")
.log("Written to output file");
}
}