我使用spring xml写了我的路线,看起来像这样
<camelContext xmlns="http://camel.apache.org/schema/spring">
<propertyPlaceholder id="properties" location="classpath:props.properties" />
<route>
<from
uri="activemq:queue:adapter.queue?mapJmsMessage=false&disableReplyTo=true" />
<log message="This is a status request"></log>
<process ref="psuedoRoute"></process>
</route>
</camelContext>
当我通过activemq端点获取Java POJO时,那就是交换体。是否可以读取此路由xml本身中的字符串成员的值?
答案 0 :(得分:0)
是的,它可能。您可以使用SPEL,它允许在您的情况下调用Java对象的方法,getter。
可能就像:
<camelContext xmlns="http://camel.apache.org/schema/spring">
<propertyPlaceholder id="properties" location="classpath:props.properties" />
<route>
<from
uri="activemq:queue:adapter.queue?mapJmsMessage=false&disableReplyTo=true" />
<log message="This is a status request"></log>
<process ref="psuedoRoute"></process>
<log message="This is a status request"></log>
<setBody>
<spel>#{body.getValue()}</spel>
</setBody>
</route>
</camelContext>