Franch
Franch

Reputation: 175

Using controlBus from spring DSL with parameters

I need to control my routes and I am using spring DSL for Camel.

I need to exposed a service which will perform thoses actions to the routeId given in paramaters.

The following code does not work (the body contain the 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>

I also tried with simple language but I can't figure out the correct syntax

Upvotes: 1

Views: 468

Answers (1)

Claus Ibsen
Claus Ibsen

Reputation: 55540

See this FAQ http://camel.apache.org/how-to-use-a-dynamic-uri-in-to.html

Use <toD> to make the to dynamic.

Upvotes: 1

Related Questions