我想在Camel Exchange上设置属性,然后在保存文件时使用此属性.在我的骆驼dsl我有以下内容:
.process(processorToSetExhangeProperty) // sets the property on the exchange
.to("file:/tmp?fileName=file-" + property("uid") + ".xml")
该文件保存为:
"file-property{uid}.xml" though
我的处理器如下:
@Override
public void process(Exchange exchange) throws Exception {
UUID uuid = UUID.randomUUID();
exchange.setProperty("uid",
uuid.toString());
exchange.setOut(exchange.getIn());
}
对于可能出现的问题或如何实现这一目标的任何想法?