[ 
https://issues.apache.org/jira/browse/CAMEL-18328?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17573431#comment-17573431
 ] 

Raymond commented on CAMEL-18328:
---------------------------------

I tested it with 3.19.0-SNAPSHOT

1) I can confirm that it works when routeConfiguration is hardcoded:
{code:java}
routeTemplate("myTemplate")
.templateParameter("in")
.templateParameter("out")
.from("{{in}}")
.routeConfigurationId("myErrorHandler")
.to("{{out}}");
{code}
 

 

2) I doesn't however work from a templateParameter:
{code:java}
routeTemplate("myTemplate") 
   .templateParameter("in") 
   .templateParameter("out")
   .templateParameter("myErrorHandlerID")
   .from("{{in}}")
   .routeConfigurationId("{{myErrorHandlerID}}")
   .to("{{out}}");

{code}

The second use case is what I like to do, because I have several 
routeConfigurations and they are chosen by the user.

BTW: The same counts for "routeId". It doesn't work with a templateParameter. 
There of course you can workaround it by setting the routeId together with the 
templateId. I thought however that both use cases would work. (both for routeId 
and routeConfigurationId).

> RouteConfiguration with RouteTemplate doesn't work
> --------------------------------------------------
>
>                 Key: CAMEL-18328
>                 URL: https://issues.apache.org/jira/browse/CAMEL-18328
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 3.18.0
>            Reporter: Raymond
>            Priority: Minor
>             Fix For: 3.18.1, 3.19.0
>
>
> I have loaded a routeConfiguration:
> {code:java}
> <routeConfiguration id="myError">
>             <onException>
>                <exception>java.lang.Exception</exception>
>                <handled>
>                   <constant>true</constant>
>                </handled>
>                <redeliveryPolicy maximumRedeliveries="0" 
> redeliveryDelay="5000"/>
>                <setExchangePattern pattern="InOnly"/>
>                <to uri="log:myError?showAll=true&amp;multiline=true"/>
>             </onException>
>          </routeConfiguration>{code}
> I have a RouteTemplate:
> {code:java}
>          routeTemplate("myTemplate")
>                  .templateParameter("in")
>                  .templateParameter("out")
>                  .from("{{in}}")
>                      .routeConfigurationId("myError")
>                      .to("{{out}}");{code}
> But this routeConfigurationId doesn't seem to take effect. When calling the 
> routeConfigurationId directly from a route is works.
> Can you reproduce this?
> BTW: What I try to achieve:
> {code:java}
>          routeTemplate("myTemplate")
>                  
> .templateParameter("routeconfiguration_id","defaultErrorHandler")
>                  .templateParameter("in")
>                  .templateParameter("out")
>                  .from("{{in}}")
>                      .routeConfigurationId("{{routeconfiguration_id}}")
>                      .to("{{out}}");{code}
> Thus adding the routeConfigurationID through a templateParameter.



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

Reply via email to