[ 
https://issues.apache.org/jira/browse/CAMEL-18626?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Raymond updated CAMEL-18626:
----------------------------
    Description: 
I would like to set the ExchangePattern dynamically with a routetemplate like 
this:
{code:java}
routeTemplate("setPattern")
    .templateParameter("in")
    .templateParameter("out")
    .templateParameter("exchangePattern")
    .from("{{in}}")
        .setExchangePattern("{{myExchangePattern}}")
        .to("{{out}}");{code}
This is currently not possible as template parameters expect only Strings. I 
tried to work around it. For example:

 
{code:java}
.setExchangePattern("ExchangePattern.valueOf({{myExchangePattern}})")

//or
.setProperty("ExchangePattern").simple("${exchange.setPattern('{{ExchangePattern}}')}")
 
{code}
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.

  was:
I would like to set the ExchangePattern dynamically with a routetemplate like 
this:


{code:java}
routeTemplate("setPattern")
    .templateParameter("in")
    .templateParameter("out")
    .templateParameter("exchangePattern")
    .from("{{in}}")
        .setExchangePattern("{{myExchangePattern}}")
        .to("{{out}}");{code}

This is currently not possible as template parameters expect only Strings. I 
tried to work around it. For example:



 
{code:java}
.setExchangePattern("ExchangePattern.valueOf({{myExchangePattern}})")

//or
.setProperty("ExchangePattern").simple("${exchange.setPattern('{{ExchangePattern}}')}")
 
{code}
But they don't work because the \{{parameter}} are interpolated too late in the 
process. For now, I used I set a property and use processor to set the 
ExchangePattern.


> Set the ExchangePattern with a routeTemplate
> --------------------------------------------
>
>                 Key: CAMEL-18626
>                 URL: https://issues.apache.org/jira/browse/CAMEL-18626
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core, eip
>    Affects Versions: 3.19.0
>            Reporter: Raymond
>            Priority: Minor
>             Fix For: 3.20.0
>
>
> I would like to set the ExchangePattern dynamically with a routetemplate like 
> this:
> {code:java}
> routeTemplate("setPattern")
>     .templateParameter("in")
>     .templateParameter("out")
>     .templateParameter("exchangePattern")
>     .from("{{in}}")
>         .setExchangePattern("{{myExchangePattern}}")
>         .to("{{out}}");{code}
> This is currently not possible as template parameters expect only Strings. I 
> tried to work around it. For example:
>  
> {code:java}
> .setExchangePattern("ExchangePattern.valueOf({{myExchangePattern}})")
> //or
> .setProperty("ExchangePattern").simple("${exchange.setPattern('{{ExchangePattern}}')}")
>  
> {code}
> 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.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to