使用带有参数的spring DSL的controlBus

时间:2016-04-14 17:43:02

标签: java spring apache-camel

我需要控制我的路线,我正在使用Spring DSL for Camel。

我需要公开一个服务,该服务将对paramaters中给出的routeId执行操作。

以下代码不起作用(正文包含routeId)

<route id="stopRoute">
            <from uri="direct:stopRoute"/>
            <log message="about to stop a route"/>

            <to uri="controlbus:route?routeId=${body}&amp;action=stop"/>
            <to uri="controlbus:route?routeId=${body}&amp;action=status"/>

</route>

我也尝试过简单的语言,但我无法弄清楚正确的语法

1 个答案:

答案 0 :(得分:1)

请参阅此常见问题解答 http://camel.apache.org/how-to-use-a-dynamic-uri-in-to.html

使用<toD>使动态化。