Эндопинт direct позволяет разделить роут на части:
from( "file:camel/input")
//.log(LoggingLevel.INFO, "Moving ${file:name} to the output directory")
.log(LoggingLevel.INFO, "Moving ${header.CamelFileName} to the output directory")
.to("file:camel/output")
.end();
from( "file:camel/input")
//.log(LoggingLevel.INFO, "Moving ${file:name} to the output directory")
.log(LoggingLevel.INFO, "Moving ${header.CamelFileName} to the direct:a")
.to("direct:a")
.end();
from( "direct:a")
.log(LoggingLevel.INFO, "Moving ${header.CamelFileName} to the output directory")
.to("file:camel/output")
.end();
<camel:route>
<camel:from uri="file:camel/input"/>
<camel:log message= "Moving ${file:name} to the output directory"/>
<camel:to uri="file:camel/output"/>
</camel:route>
<camel:route>
<camel:from uri="file:camel/input"/>
<camel:log message= "Moving ${file:name} to the direct:a"/>
<camel:to uri="direct:a" />
</camel:route>
<camel:route>
<camel:from uri="direct:a"/>
<camel:log message= "Moving ${file:name} to the output directory"/>
<camel:to uri="file:camel/output"/>
</camel:route>