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

Claus Ibsen commented on CAMEL-16552:
-------------------------------------

Its not a yaml dsl problem, but that you are using spring boot yaml 
configuration which has that limitation.

> camel-spring-boot - Configuring route templates trouble setting route id when 
> using spring yaml configuration
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-16552
>                 URL: https://issues.apache.org/jira/browse/CAMEL-16552
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-main
>    Affects Versions: 3.7.3
>            Reporter: Andreas Klug
>            Priority: Minor
>             Fix For: 3.10.0
>
>
> In BaseMainSupport.java the route id to be used for routes instantiated based 
> on templates using properties seems to be determined by using square brackets 
> with non-number indices (see CAMEL-15270):
> ...
> > String id = StringHelper.between(entry.getKey(), "[", "]"); ...
> > source.addParameter(id, key, entry.getValue()); ...
> > 
> I fear that may break compatibility with YAML formatted application 
> configuration files, or at least I can't figure out how to model it in YAML.
> My attempts are shown in the two YAML excepts below, which will cause
> "binding to target [Bindable@7af327e3 type = 
> java.util.List<java.util.Map<java.lang.String, java.lang.String>> failed".
> The first example results in properties generated i. e. 
> camel.route-template.config[4][0].auto-start, as I can't get around the yaml 
> list.
>  
>  1)
>  camel:
>      route-template:
>          config:
>              "[4]":
>                  - template-id:   "template-route"
>                    ...
>  2)
>  camel:
>      route-template:
>          config:
>              "[4]":
>                  template-id:   "template-route"
>                  ...
>  
> Pls. provide a possibility or an example to configure routes based on 
> templates in YAML.
>  
> Additional remark: I tried to set the route id in a route template definition 
> converter, however, in DefaultModel.java, the id is overwritten after the 
> converter is applied:
> RouteDefinition def = converter.apply(target, prop);
>  if (routeId != null) {
>  def.setId(routeId);
>  }
> Is that intended?
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to