我想在我的过程方法中设置一些属性,但我无法弄清楚如何在xml中使用这些属性,就像我可以轻松地在xml中使用标题值使用语法:$ {} in.header.myKey骆驼 - 在春季使用财产DSL
这里是我的代码:
<route>
<from uri="activemq:queue:start.queue" />
<to uri="stream:out" />
<process ref="jsonProcessor"></process>
<to uri="bean:validateInputIdentifiers?method=validation(${in.property.SourceMap}, ${in.property.DestinationMap})" />
</route>
这里in.property.SourceMap是未知的功能。什么是正确的方法? 如果它是类似于标题的话,它会很棒。此外,我想仅使用属性而不是标题,因为标题的值可能不会在我的路线中保留。
这里的处理方法的代码:
@Override
public void process(Exchange exchange) throws Exception {
List<Map<String, String>> body = exchange.getIn().getBody(List.class);
Map<String, String> sourceMap = body.get(0);
Map<String, String> destinationMap = body.get(1);
exchange.setProperty("SourceMap", sourceMap);
exchange.setProperty("DestinationMap", destinationMap);
}
请提供了解决方案。