Andreas Klug created CAMEL-16552:
------------------------------------

             Summary: RouteId specification for property based-template 
instantiation breaking YAML compatibility?
                 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


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.



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

Reply via email to