You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2020/08/07 12:25:00 UTC
[jira] [Resolved] (CAMEL-15385) camel-main - Properties ordering
should use #class: first
[ https://issues.apache.org/jira/browse/CAMEL-15385?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-15385.
---------------------------------
Resolution: Implemented
The binding support already set reference first, eg # syntax, so that means
main.addProperty("camel.component.seda.defaultQueueFactory.counter", "123");
main.addProperty("camel.component.seda.defaultQueueFactory", "#class:org.apache.camel.main.MySedaBlockingQueueFactory");
Then the #class will be set first before the counter
> camel-main - Properties ordering should use #class: first
> ---------------------------------------------------------
>
> Key: CAMEL-15385
> URL: https://issues.apache.org/jira/browse/CAMEL-15385
> Project: Camel
> Issue Type: New Feature
> Reporter: Claus Ibsen
> Priority: Major
> Fix For: 3.5.0
>
>
> camel-kafka-connector does this
> {code}
> // reordering properties to place the one starting with "#class:" first
> LinkedHashMap<String, String> orderedProps = new LinkedHashMap<>();
> props.keySet().stream()
> .filter(k -> props.get(k).startsWith("#class:"))
> .forEach(k -> orderedProps.put(k, props.get(k)));
> props.keySet().stream()
> .filter(k -> !props.get(k).startsWith("#class:"))
> .forEach(k -> orderedProps.put(k, props.get(k)));
> {code}
> Seems like a good idea to make camel-main resolve the class first so any nested properties can be set on the created class.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)