dynamic change endpoint camel

apache-camel, dynamic, endpoint

Solution

You would need to

- stop the route

- remove the route

- change the endpoint

- add the route

- start the route

This allows you to change the from endpoint to whatever you want (for example something else)

Some components / endpoint do allow to change options an have those being updated at runtime. For example the JMS endpoint allows this, so you can

- stop the route

- change an option on the jms endpoint

- start the route

But there may be some components which cannot do that.

Problem

Is it possible to change from endpoint in dynamic way ? for example I want change ``` for(endpointFirst).routeId(ROUTEID).to(finishEndpoint); ``` to ``` for(endpointSecond).routeId(ROUTEID).to(finishEndpoint); ``` I try use ``` camelContext.stopRoute(TestRoute.ROUTEID); ``` change old endpoint to new endpoint ``` camelContext.startRoute(TestRoute.ROUTEID); ``` but my efforts not work properly. thanks for any help

Original source