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

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

commit d5cad6a36e022541beaf6fc3545d9feb99b63150
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Tue Feb 15 10:26:41 2022 +0100

    CAMEL-17647: camel-core - Properties component should support pluggable 
functions
---
 .../main/java/org/apache/camel/spi/PropertiesFunctionFactory.java    | 2 +-
 .../camel/component/properties/PropertiesFunctionResolver.java       | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git 
a/core/camel-api/src/main/java/org/apache/camel/spi/PropertiesFunctionFactory.java
 
b/core/camel-api/src/main/java/org/apache/camel/spi/PropertiesFunctionFactory.java
index 53045b3..1e04d3f 100644
--- 
a/core/camel-api/src/main/java/org/apache/camel/spi/PropertiesFunctionFactory.java
+++ 
b/core/camel-api/src/main/java/org/apache/camel/spi/PropertiesFunctionFactory.java
@@ -24,7 +24,7 @@ public interface PropertiesFunctionFactory {
     /**
      * Service factory key.
      */
-    String FACTORY = "properties-function-factory";
+    String FACTORY = "properties-function";
 
     /**
      * Creates the {@link PropertiesFunction}
diff --git 
a/core/camel-base/src/main/java/org/apache/camel/component/properties/PropertiesFunctionResolver.java
 
b/core/camel-base/src/main/java/org/apache/camel/component/properties/PropertiesFunctionResolver.java
index 41ca53e..f6cff57 100644
--- 
a/core/camel-base/src/main/java/org/apache/camel/component/properties/PropertiesFunctionResolver.java
+++ 
b/core/camel-base/src/main/java/org/apache/camel/component/properties/PropertiesFunctionResolver.java
@@ -80,11 +80,12 @@ public final class PropertiesFunctionResolver implements 
CamelContextAware {
     public PropertiesFunction resolvePropertiesFunction(String name) {
         PropertiesFunction answer = functions.get(name);
         if (answer == null) {
+            // it may be a custom function from a 3rd party JAR so use factory 
finder
             ExtendedCamelContext ecc = 
camelContext.adapt(ExtendedCamelContext.class);
-            FactoryFinder ff = 
ecc.getBootstrapFactoryFinder(PropertiesFunctionFactory.FACTORY);
+            FactoryFinder finder = 
ecc.getBootstrapFactoryFinder(PropertiesFunctionFactory.FACTORY);
 
             PropertiesFunctionFactory factory
-                    = ResolverHelper.resolveService(ecc, ff, name, 
PropertiesFunctionFactory.class).orElse(null);
+                    = ResolverHelper.resolveService(ecc, finder, name, 
PropertiesFunctionFactory.class).orElse(null);
             if (factory != null) {
                 answer = factory.createPropertiesFunction();
                 if (answer != null) {

Reply via email to