You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2020/03/27 08:57:27 UTC

[camel] branch master updated: Should in theory set PropertiesComponent before we may use it in the parse methods to set the other options

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new 8a3aa56  Should in theory set PropertiesComponent before we may use it in the parse methods to set the other options
8a3aa56 is described below

commit 8a3aa565a7441cc9451351dfb6f5898cceee404b
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Mar 27 09:33:20 2020 +0100

    Should in theory set PropertiesComponent before we may use it in the parse methods to set the other options
---
 .../camel/core/xml/AbstractCamelContextFactoryBean.java    | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java b/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
index be5dfc6..6bb4fe7 100644
--- a/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
+++ b/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
@@ -173,6 +173,13 @@ public abstract class AbstractCamelContextFactoryBean<T extends ModelCamelContex
             throw new IllegalArgumentException("Id must be set");
         }
 
+        // set properties as early as possible
+        PropertiesComponent pc = getBeanForType(PropertiesComponent.class);
+        if (pc != null) {
+            LOG.debug("Using PropertiesComponent: {}", pc);
+            getContext().setPropertiesComponent(pc);
+        }
+
         // set the package scan resolver as soon as possible
         PackageScanClassResolver packageResolver = getBeanForType(PackageScanClassResolver.class);
         if (packageResolver != null) {
@@ -192,13 +199,6 @@ public abstract class AbstractCamelContextFactoryBean<T extends ModelCamelContex
             getContext().setLoadTypeConverters(CamelContextHelper.parseBoolean(getContext(), getLoadTypeConverters()));
         }
 
-        // then properties component
-        PropertiesComponent pc = getBeanForType(PropertiesComponent.class);
-        if (pc != null) {
-            LOG.debug("Using PropertiesComponent: {}", pc);
-            getContext().setPropertiesComponent(pc);
-        }
-
         // then set custom properties
         Map<String, String> mergedOptions = new HashMap<>();
         if (getGlobalOptions() != null) {