Skip to content
Advertisement

Use Exchange Property in Camel DSL “to”

I want to set a property on a Camel Exchange and then use this property when saving the file. In my camel dsl I have the following:

JavaScript

The file is being saved as:

JavaScript

My processor is as follows:

JavaScript

Any thoughts on what may be going wrong or how I can achieve this?

Advertisement

Answer

The to in the Camel is not interpreted at runtime.

You should use recipientList if you want to construct your URI dynamically. See https://camel.apache.org/manual/latest/faq/how-to-use-a-dynamic-uri-in-to.html

Advertisement