Is it possible to change from endpoint in dynamic way ? for example I want change
for(endpointFirst).routeId(ROUTEID).to(finishEndpoint);
You would need to
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
But there may be some components which cannot do that.
to change the from
endpoint, you can just dynamically add/remove routes via the context APIs or alter the route as Claus suggested
to change destination endpoints, use the recipient list EIP and an Expression to dynamically determine the endpoint based on message headers, variables, methods, etc...
from("direct:a")
.recipientList(header("foo"));