There is something interesting about Camel Routes.

Usually they are defined in the beginning and assumed to have the same endpoints. But today I had a situation when depending on the .process() execution the result endpoint had to be dynamic.

So after consulting with one of my colleagues I found the following solution:

public class CustomRoute extends RouteBuilder {

    public void configure() throws Exception {
                .process(exchange -> exchange.setProperty("customDestinationProperty", "customPropertyDestinationValue");)

BUT THIS DOES NOT WORK … the problem is about to()

you have to use .toD() instead.

check – the “Dynamic To” part.

Hope this helps you 😉


Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.