这是我的路线:
<route id="comingFromSomewhere">
<from uri="direct:comingFromSomewhere" ></from>
<process ref="placeHolderProcessor" ></process>
<to uri="file://{{property.FinalPath}}" />
</route>
这是我的处理器:
public class PlaceHolderProcessor implements Processor {
String gerantOutPutFilePath="C:/{clientName}/OUTPUT";
@Override
public void process(Exchange exchange) throws Exception {
String fileName = (String) exchange.getIn().getHeader("CamelFileName");
String clientName= (trioptimaFileName.split("-"))[0].toUpperCase();
String path = gerantOutPutFilePath.replace("{clientName}", clientName);
exchange.setProperty("FinalPath", path);
}
}
当我尝试根据输入文件名动态更改输出路径时。它不适合我。像问题这样的问题是在<to uri="file://{{property.FinalPath}}" />
&#39;有人可以帮我修理一下吗?
答案 0 :(得分:0)
像这样使用Camel的dynamic message endpoint:
<toD uri="file://${property.FinalPath}/" />