Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
3.19.0
-
None
-
Unknown
Description
I would like to set the ExchangePattern dynamically with a routetemplate like this:
routeTemplate("setPattern") .templateParameter("in") .templateParameter("out") .templateParameter("exchangePattern") .from("{{in}}") .setExchangePattern("{{myExchangePattern}}") .to("{{out}}");
This is currently not possible as template parameters expect only Strings. I tried to work around it. For example:
.setExchangePattern("ExchangePattern.valueOf({{myExchangePattern}})") //or .setProperty("ExchangePattern").simple("${exchange.setPattern('{{ExchangePattern}}')}")
But they don't work because the parameter are interpolated too late in the process. For now, I set a property and use processor to set the ExchangePattern.