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 2019/08/20 19:05:20 UTC

[camel] branch CAMEL-13870 created (now 8ca15bc)

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

davsclaus pushed a change to branch CAMEL-13870
in repository https://gitbox.apache.org/repos/asf/camel.git.


      at 8ca15bc  CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.

This branch includes the following new commits:

     new 273d192  CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
     new 1d4c097  CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
     new 8da3dbe  CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
     new 6c3447f  CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
     new fd3d33b  CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
     new 3af0ee2  CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
     new 31cf888  CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
     new adb0a34  CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
     new e15a5b8  CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
     new b1ac540  CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
     new 0cd1025  CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
     new 8ca15bc  CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.

The 12 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[camel] 01/12: CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 273d192d96c69a828223a5877492f6a170460b6f
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Aug 19 20:44:10 2019 +0200

    CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
---
 ...lderConfigurer.java => PropertyConfigurer.java} | 12 ++++++++---
 .../camel/spi/PropertyPlaceholderConfigurer.java   | 25 ++++------------------
 2 files changed, 13 insertions(+), 24 deletions(-)

diff --git a/core/camel-api/src/main/java/org/apache/camel/spi/PropertyPlaceholderConfigurer.java b/core/camel-api/src/main/java/org/apache/camel/spi/PropertyConfigurer.java
similarity index 76%
copy from core/camel-api/src/main/java/org/apache/camel/spi/PropertyPlaceholderConfigurer.java
copy to core/camel-api/src/main/java/org/apache/camel/spi/PropertyConfigurer.java
index e502ed7..774c614 100644
--- a/core/camel-api/src/main/java/org/apache/camel/spi/PropertyPlaceholderConfigurer.java
+++ b/core/camel-api/src/main/java/org/apache/camel/spi/PropertyConfigurer.java
@@ -22,7 +22,13 @@ import java.util.function.Supplier;
 
 import org.apache.camel.CamelContext;
 
-public interface PropertyPlaceholderConfigurer {
+/**
+ * A configurer for properties on a given object.
+ * <p/>
+ * This is used in Camel to have fast property configuration of Camel components & endpoints,
+ * and for EIP patterns as well.
+ */
+public interface PropertyConfigurer<T> {
 
     /**
      * Gets the options which supports property placeholders and can be resolved.
@@ -30,12 +36,12 @@ public interface PropertyPlaceholderConfigurer {
      *
      * @return key/values of options
      */
-    Map<String, Supplier<String>> getReadPropertyPlaceholderOptions(CamelContext camelContext);
+    Map<String, Supplier<T>> getReadPropertyPlaceholderOptions(CamelContext camelContext);
 
     /**
      * To update an existing property using the function with the key/value and returning the changed value
      * This will be all the string based options.
      */
-    Map<String, Consumer<String>> getWritePropertyPlaceholderOptions(CamelContext camelContext);
+    Map<String, Consumer<T>> getWritePropertyPlaceholderOptions(CamelContext camelContext);
 
 }
diff --git a/core/camel-api/src/main/java/org/apache/camel/spi/PropertyPlaceholderConfigurer.java b/core/camel-api/src/main/java/org/apache/camel/spi/PropertyPlaceholderConfigurer.java
index e502ed7..19e4cbd 100644
--- a/core/camel-api/src/main/java/org/apache/camel/spi/PropertyPlaceholderConfigurer.java
+++ b/core/camel-api/src/main/java/org/apache/camel/spi/PropertyPlaceholderConfigurer.java
@@ -16,26 +16,9 @@
  */
 package org.apache.camel.spi;
 
-import java.util.Map;
-import java.util.function.Consumer;
-import java.util.function.Supplier;
-
-import org.apache.camel.CamelContext;
-
-public interface PropertyPlaceholderConfigurer {
-
-    /**
-     * Gets the options which supports property placeholders and can be resolved.
-     * This will be all the string based options.
-     *
-     * @return key/values of options
-     */
-    Map<String, Supplier<String>> getReadPropertyPlaceholderOptions(CamelContext camelContext);
-
-    /**
-     * To update an existing property using the function with the key/value and returning the changed value
-     * This will be all the string based options.
-     */
-    Map<String, Consumer<String>> getWritePropertyPlaceholderOptions(CamelContext camelContext);
+/**
+ * A {@link PropertyConfigurer} which is used for property placeholders which are string based values only.
+ */
+public interface PropertyPlaceholderConfigurer extends PropertyConfigurer<String> {
 
 }


[camel] 06/12: CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 3af0ee29825949ccb315894df22608fd0529054a
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Aug 20 17:27:17 2019 +0200

    CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
---
 .../camel-cxf/src/main/docs/cxf-component.adoc     |   2 +-
 .../camel-cxf/src/main/docs/cxfrs-component.adoc   |   4 +-
 ...ntConfigurer.java => ChainedCxfConfigurer.java} |  20 +--
 ...fEndpointConfigurer.java => CxfConfigurer.java} |   7 +-
 .../apache/camel/component/cxf/CxfConsumer.java    |   6 +-
 .../apache/camel/component/cxf/CxfEndpoint.java    | 140 ++++++++++-----------
 .../camel/component/cxf/CxfEndpointUtils.java      |  22 ++--
 .../apache/camel/component/cxf/CxfProducer.java    |   4 +-
 .../camel/component/cxf/CxfSpringEndpoint.java     |  32 ++---
 ...rer.java => HostnameVerifierCxfConfigurer.java} |  10 +-
 ...dpointConfigurer.java => SslCxfConfigurer.java} |  12 +-
 ...Configurer.java => ChainedCxfRsConfigurer.java} |  20 +--
 ...ndpointConfigurer.java => CxfRsConfigurer.java} |   7 +-
 .../camel/component/cxf/jaxrs/CxfRsEndpoint.java   |  60 ++++-----
 ...r.java => HostnameVerifierCxfRsConfigurer.java} |  10 +-
 ...ointConfigurer.java => SslCxfRsConfigurer.java} |  12 +-
 .../spring/CxfEndpointBeanDefinitionParser.java    |   4 +-
 .../camel/component/cxf/CxfEndpointTest.java       |   4 +-
 .../cxf/CxfJavaOnlyCamelContextAwareTest.java      |   4 +-
 .../apache/camel/component/cxf/CxfTimeoutTest.java |   5 +-
 .../component/cxf/jaxrs/CxfRsConsumerTest.java     |   4 +-
 .../jaxrs/CxfRsProducerEndpointConfigurerTest.java |   4 +-
 .../component/cxf/spring/CxfEndpointBeanTest.java  |   4 +-
 .../cxf/spring/CxfEndpointBeansRouterTest.java     |   4 +-
 .../component/cxf/util/CxfEndpointUtilsTest.java   |   2 +-
 .../cxf/util/CxfEndpointUtilsWithSpringTest.java   |   2 +-
 .../component/cxf/cxfConduitTimeOutContext.xml     |   2 +-
 .../apache/camel/component/ipfs/IPFSEndpoint.java  |   3 +-
 .../endpoint/dsl/CxfEndpointBuilderFactory.java    |  52 ++++----
 .../endpoint/dsl/CxfRsEndpointBuilderFactory.java  |  76 +++++------
 .../camel/support/PropertyBindingSupport.java      |  16 +--
 .../EndpointPropertyConfigurerSupport.java         |  41 ++++++
 .../tools/apt/EndpointAnnotationProcessor.java     |  24 ++--
 .../apt/EndpointPropertyConfigurerGenerator.java   |   7 +-
 .../java/org/apache/camel/spi/UriEndpoint.java     |   7 ++
 35 files changed, 313 insertions(+), 320 deletions(-)

diff --git a/components/camel-cxf/src/main/docs/cxf-component.adoc b/components/camel-cxf/src/main/docs/cxf-component.adoc
index c52becd..a90f54f 100644
--- a/components/camel-cxf/src/main/docs/cxf-component.adoc
+++ b/components/camel-cxf/src/main/docs/cxf-component.adoc
@@ -142,7 +142,7 @@ with the following path and query parameters:
 | *bus* (advanced) | To use a custom configured CXF Bus. |  | Bus
 | *continuationTimeout* (advanced) | This option is used to set the CXF continuation timeout which could be used in CxfConsumer by default when the CXF server is using Jetty or Servlet transport. | 30000 | long
 | *cxfBinding* (advanced) | To use a custom CxfBinding to control the binding between Camel Message and CXF Message. |  | CxfBinding
-| *cxfEndpointConfigurer* (advanced) | This option could apply the implementation of org.apache.camel.component.cxf.CxfEndpointConfigurer which supports to configure the CXF endpoint in programmatic way. User can configure the CXF server and client by implementing configure\{ServerClient\} method of CxfEndpointConfigurer. |  | CxfEndpointConfigurer
+| *cxfConfigurer* (advanced) | This option could apply the implementation of org.apache.camel.component.cxf.CxfEndpointConfigurer which supports to configure the CXF endpoint in programmatic way. User can configure the CXF server and client by implementing configure\{ServerClient\} method of CxfEndpointConfigurer. |  | CxfConfigurer
 | *defaultBus* (advanced) | Will set the default bus when CXF endpoint create a bus by itself | false | boolean
 | *headerFilterStrategy* (advanced) | To use a custom HeaderFilterStrategy to filter header to and from Camel message. |  | HeaderFilterStrategy
 | *mergeProtocolHeaders* (advanced) | Whether to merge protocol headers. If enabled then propagating headers between Camel and CXF becomes more consistent and similar. For more details see CAMEL-6393. | false | boolean
diff --git a/components/camel-cxf/src/main/docs/cxfrs-component.adoc b/components/camel-cxf/src/main/docs/cxfrs-component.adoc
index a2d8379..fbacacb 100644
--- a/components/camel-cxf/src/main/docs/cxfrs-component.adoc
+++ b/components/camel-cxf/src/main/docs/cxfrs-component.adoc
@@ -103,7 +103,7 @@ with the following path and query parameters:
 | *publishedEndpointUrl* (consumer) | This option can override the endpointUrl that published from the WADL which can be accessed with resource address url plus _wadl |  | String
 | *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. |  | ExceptionHandler
 | *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. |  | ExchangePattern
-| *serviceBeans* (consumer) | The service beans which you want to export as REST service. Multiple beans can be separated by comma. |  | List
+| *serviceBeans* (consumer) | The service beans (the bean ids to lookup in the registry) which you want to export as REST service. Multiple beans can be separated by comma |  | String
 | *cookieHandler* (producer) | Configure a cookie handler to maintain a HTTP session |  | CookieHandler
 | *hostnameVerifier* (producer) | The hostname verifier to be used. Use the # notation to reference a HostnameVerifier from the registry. |  | HostnameVerifier
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
@@ -116,7 +116,7 @@ with the following path and query parameters:
 | *binding* (advanced) | To use a custom CxfBinding to control the binding between Camel Message and CXF Message. |  | CxfRsBinding
 | *bus* (advanced) | To use a custom configured CXF Bus. |  | Bus
 | *continuationTimeout* (advanced) | This option is used to set the CXF continuation timeout which could be used in CxfConsumer by default when the CXF server is using Jetty or Servlet transport. | 30000 | long
-| *cxfRsEndpointConfigurer* (advanced) | This option could apply the implementation of org.apache.camel.component.cxf.jaxrs.CxfRsEndpointConfigurer which supports to configure the CXF endpoint in programmatic way. User can configure the CXF server and client by implementing configure{Server/Client} method of CxfEndpointConfigurer. |  | CxfRsEndpoint Configurer
+| *cxfRsConfigurer* (advanced) | This option could apply the implementation of org.apache.camel.component.cxf.jaxrs.CxfRsEndpointConfigurer which supports to configure the CXF endpoint in programmatic way. User can configure the CXF server and client by implementing configure{Server/Client} method of CxfEndpointConfigurer. |  | CxfRsConfigurer
 | *defaultBus* (advanced) | Will set the default bus when CXF endpoint create a bus by itself | false | boolean
 | *headerFilterStrategy* (advanced) | To use a custom HeaderFilterStrategy to filter header to and from Camel message. |  | HeaderFilterStrategy
 | *performInvocation* (advanced) | When the option is true, Camel will perform the invocation of the resource class instance and put the response object into the exchange for further processing. | false | boolean
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/ChainedCxfEndpointConfigurer.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/ChainedCxfConfigurer.java
similarity index 72%
rename from components/camel-cxf/src/main/java/org/apache/camel/component/cxf/ChainedCxfEndpointConfigurer.java
rename to components/camel-cxf/src/main/java/org/apache/camel/component/cxf/ChainedCxfConfigurer.java
index 887c995..05b4a0c 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/ChainedCxfEndpointConfigurer.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/ChainedCxfConfigurer.java
@@ -20,24 +20,24 @@ import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory;
 
-public final class ChainedCxfEndpointConfigurer implements CxfEndpointConfigurer {
-    private CxfEndpointConfigurer parent;
-    private CxfEndpointConfigurer child;
+public final class ChainedCxfConfigurer implements CxfConfigurer {
+    private CxfConfigurer parent;
+    private CxfConfigurer child;
 
-    private ChainedCxfEndpointConfigurer() {
+    private ChainedCxfConfigurer() {
     }
 
-    public static ChainedCxfEndpointConfigurer create(CxfEndpointConfigurer parent, CxfEndpointConfigurer child) {
-        ChainedCxfEndpointConfigurer result = new ChainedCxfEndpointConfigurer();
+    public static ChainedCxfConfigurer create(CxfConfigurer parent, CxfConfigurer child) {
+        ChainedCxfConfigurer result = new ChainedCxfConfigurer();
         result.parent = parent;
         result.child = child;
         return result;
     }
 
-    public ChainedCxfEndpointConfigurer addChild(CxfEndpointConfigurer cxfEndpointConfigurer) {
-        ChainedCxfEndpointConfigurer result = new ChainedCxfEndpointConfigurer();
+    public ChainedCxfConfigurer addChild(CxfConfigurer cxfConfigurer) {
+        ChainedCxfConfigurer result = new ChainedCxfConfigurer();
         result.parent = this;
-        result.child = cxfEndpointConfigurer;
+        result.child = cxfConfigurer;
         return result;
     }
 
@@ -59,7 +59,7 @@ public final class ChainedCxfEndpointConfigurer implements CxfEndpointConfigurer
         child.configureServer(server);
     }
 
-    public static class NullCxfEndpointConfigurer implements CxfEndpointConfigurer {
+    public static class NullCxfConfigurer implements CxfConfigurer {
 
         @Override
         public void configure(AbstractWSDLBasedEndpointFactory factoryBean) {
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpointConfigurer.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConfigurer.java
similarity index 91%
rename from components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpointConfigurer.java
rename to components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConfigurer.java
index dffeb3b..0adaf8c 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpointConfigurer.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConfigurer.java
@@ -21,13 +21,14 @@ import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory;
 
 /**
- * A pluggable strategy for configuring the cxfEndpoint by using java code
+ * A pluggable strategy for configuring the CXF by using java code
  */
-public interface CxfEndpointConfigurer {
+public interface CxfConfigurer {
     
     /**
      * Configure the CXF Server/Client factory bean
-     * @param factoryBean
+     *
+     * @param factoryBean the factory bean
      */
     void configure(AbstractWSDLBasedEndpointFactory factoryBean);
     
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java
index ac16000..8b9c22e 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java
@@ -70,8 +70,8 @@ public class CxfConsumer extends DefaultConsumer implements Suspendable {
         svrBean.setInvoker(new CxfConsumerInvoker(cxfEndpoint));
         Server server = svrBean.create();
         // Apply the server configurer if it is possible
-        if (cxfEndpoint.getCxfEndpointConfigurer() != null) {
-            cxfEndpoint.getCxfEndpointConfigurer().configureServer(server);
+        if (cxfEndpoint.getCxfConfigurer() != null) {
+            cxfEndpoint.getCxfConfigurer().configureServer(server);
         }
         server.getEndpoint().getEndpointInfo().setProperty("serviceClass", cxfEndpoint.getServiceClass());
         if (ObjectHelper.isNotEmpty(cxfEndpoint.getPublishedEndpointUrl())) {
@@ -288,7 +288,7 @@ public class CxfConsumer extends DefaultConsumer implements Suspendable {
 
             camelExchange.setProperty(Message.MTOM_ENABLED, String.valueOf(endpoint.isMtomEnabled()));
 
-            if (endpoint.getMergeProtocolHeaders()) {
+            if (endpoint.isMergeProtocolHeaders()) {
                 camelExchange.setProperty(CxfConstants.CAMEL_CXF_PROTOCOL_HEADERS_MERGED, Boolean.TRUE);
             }
             // bind the CXF request into a Camel exchange
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
index b37bedf..0f2986a 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
@@ -67,7 +67,6 @@ import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriPath;
 import org.apache.camel.support.DefaultEndpoint;
-import org.apache.camel.support.EndpointHelper;
 import org.apache.camel.support.PropertyBindingSupport;
 import org.apache.camel.support.SynchronousDelegateProducer;
 import org.apache.camel.support.jsse.SSLContextParameters;
@@ -148,12 +147,12 @@ public class CxfEndpoint extends DefaultEndpoint implements AsyncEndpoint, Heade
     private String wsdlURL;
     @UriParam(label = "service")
     private Class<?> serviceClass;
-    @UriParam(label = "service", name = "portName")
-    private String portNameString;
-    private QName portName;
-    @UriParam(label = "service", name = "serviceName")
-    private String serviceNameString;
-    private QName serviceName;
+    @UriParam(label = "service")
+    private String portName;
+    private transient QName portNameQName;
+    @UriParam(label = "service")
+    private String serviceName;
+    private transient QName serviceNameQName;
     @UriParam(label = "service")
     private String bindingId;
     @UriParam(label = "service")
@@ -191,7 +190,7 @@ public class CxfEndpoint extends DefaultEndpoint implements AsyncEndpoint, Heade
     @UriParam(label = "advanced")
     private boolean mergeProtocolHeaders;
     @UriParam(label = "advanced")
-    private CxfEndpointConfigurer cxfEndpointConfigurer;
+    private CxfConfigurer cxfConfigurer;
     @UriParam(label = "advanced", defaultValue = "30000")
     private long continuationTimeout = 30000;
     @UriParam(label = "security", secret = true)
@@ -288,14 +287,14 @@ public class CxfEndpoint extends DefaultEndpoint implements AsyncEndpoint, Heade
             sfb.setWsdlURL(getWsdlURL());
         }
 
-        // service  name qname
-        if (getServiceName() != null) {
-            sfb.setServiceName(getServiceName());
+        // service name qname
+        if (getServiceNameAsQName() != null) {
+            sfb.setServiceName(getServiceNameAsQName());
         }
 
         // port qname
-        if (getPortName() != null) {
-            sfb.setEndpointName(getPortName());
+        if (getPortNameAsQName() != null) {
+            sfb.setEndpointName(getPortNameAsQName());
         }
 
         // apply feature here
@@ -363,7 +362,7 @@ public class CxfEndpoint extends DefaultEndpoint implements AsyncEndpoint, Heade
 
         sfb.setBus(getBus());
         sfb.setStart(false);
-        getNullSafeCxfEndpointConfigurer().configure(sfb);
+        getNullSafeCxfConfigurer().configure(sfb);
     }
 
     /**
@@ -486,13 +485,13 @@ public class CxfEndpoint extends DefaultEndpoint implements AsyncEndpoint, Heade
         }
 
         // service name qname
-        if (getServiceName() != null) {
-            factoryBean.setServiceName(getServiceName());
+        if (getServiceNameAsQName() != null) {
+            factoryBean.setServiceName(getServiceNameAsQName());
         }
 
         // port name qname
-        if (getPortName() != null) {
-            factoryBean.setEndpointName(getPortName());
+        if (getPortNameAsQName() != null) {
+            factoryBean.setEndpointName(getPortNameAsQName());
         }
 
         // apply feature here
@@ -561,7 +560,7 @@ public class CxfEndpoint extends DefaultEndpoint implements AsyncEndpoint, Heade
 
         factoryBean.setBus(getBus());
 
-        getNullSafeCxfEndpointConfigurer().configure(factoryBean);
+        getNullSafeCxfConfigurer().configure(factoryBean);
     }
 
     // Package private methods
@@ -769,39 +768,29 @@ public class CxfEndpoint extends DefaultEndpoint implements AsyncEndpoint, Heade
     /**
      * The service name this service is implementing, it maps to the wsdl:service@name.
      */
-    public void setServiceNameString(String service) {
-        serviceNameString = service;
-    }
-
-    /**
-     * The service name this service is implementing, it maps to the wsdl:service@name.
-     */
-    public void setServiceName(QName service) {
+    public void setServiceName(String service) {
         serviceName = service;
     }
 
-    /**
-     * The service name this service is implementing, it maps to the wsdl:service@name.
-     */
-    public void setService(String service) {
-        serviceNameString = service;
+    public String getServiceName() {
+        return serviceName;
     }
 
-    public QName getServiceName() {
-        if (serviceName == null && serviceNameString != null) {
-            serviceName = QName.valueOf(resolvePropertyPlaceholders(serviceNameString));
+    public QName getServiceNameAsQName() {
+        if (serviceNameQName == null && serviceName != null) {
+            serviceNameQName = QName.valueOf(resolvePropertyPlaceholders(serviceName));
         }
         //if not specify the service name and if the wsdlUrl is available,
         //parse the wsdl to see if only one service in it, if so set the only service
         //from wsdl to avoid ambiguity
-        if (serviceName == null && getWsdlURL() != null) {
+        if (serviceNameQName == null && getWsdlURL() != null) {
             // use wsdl manager to parse wsdl or get cached
             // definition
             try {
                 Definition definition = getBus().getExtension(WSDLManager.class)
                         .getDefinition(getWsdlURL());
                 if (definition.getServices().size() == 1) {
-                    serviceName = (QName) definition.getServices().keySet()
+                    serviceNameQName = (QName) definition.getServices().keySet()
                         .iterator().next();
 
                 }
@@ -809,46 +798,43 @@ public class CxfEndpoint extends DefaultEndpoint implements AsyncEndpoint, Heade
                 throw new RuntimeException(e);
             }
         }
-        return serviceName;
+        return serviceNameQName;
     }
 
-    public QName getPortName() {
-        if (portName == null && portNameString != null) {
-            portName = QName.valueOf(resolvePropertyPlaceholders(portNameString));
-        }
-        return portName;
+    public void setServiceNameAsQName(QName qName) {
+        this.serviceNameQName = qName;
     }
 
-    /**
-     * The endpoint name this service is implementing, it maps to the wsdl:port@name. In the format of ns:PORT_NAME where ns is a namespace prefix valid at this scope.
-     */
-    public void setPortName(QName port) {
-        portName = port;
+    public QName getPortNameAsQName() {
+        if (portNameQName == null && portName != null) {
+            portNameQName = QName.valueOf(resolvePropertyPlaceholders(portName));
+        }
+        return portNameQName;
     }
 
-    /**
-     * The endpoint name this service is implementing, it maps to the wsdl:port@name. In the format of ns:PORT_NAME where ns is a namespace prefix valid at this scope.
-     */
-    public void setPortNameString(String portNameString) {
-        this.portNameString = portNameString;
+    public void setPortNameAsQName(QName qName) {
+        this.portNameQName = qName;
     }
 
-    public void setPortName(String portName) {
-        portNameString = portName;
+    public String getPortName() {
+        return portName;
     }
 
     /**
-     * The port name this service is implementing, it maps to the wsdl:port@name.
+     * The endpoint name this service is implementing, it maps to the wsdl:port@name. In the format of ns:PORT_NAME where ns is a namespace prefix valid at this scope.
      */
-    public void setEndpointNameString(String port) {
-        portNameString = port;
+    public void setPortName(String port) {
+        portName = port;
     }
 
-    /**
-     * The port name this service is implementing, it maps to the wsdl:port@name.
-     */
-    public void setEndpointName(QName port) {
-        portName = port;
+    public void setEndpointName(String name) {
+        // this is on purpose as camel-cxf in xml-dsl uses endpoint-name as port-name
+        portName = name;
+    }
+
+    public void setEndpointNameAsQName(QName qName) {
+        // this is on purpose as camel-cxf in xml-dsl uses endpoint-name as port-name
+        portNameQName = qName;
     }
 
     public String getDefaultOperationName() {
@@ -1126,18 +1112,18 @@ public class CxfEndpoint extends DefaultEndpoint implements AsyncEndpoint, Heade
         this.username = username;
     }
 
-    public CxfEndpointConfigurer getChainedCxfEndpointConfigurer() {
-        return ChainedCxfEndpointConfigurer
-                .create(getNullSafeCxfEndpointConfigurer(),
-                        SslCxfEndpointConfigurer.create(sslContextParameters, getCamelContext()))
-                .addChild(HostnameVerifierCxfEndpointConfigurer.create(hostnameVerifier));
+    public CxfConfigurer getChainedCxfConfigurer() {
+        return ChainedCxfConfigurer
+                .create(getNullSafeCxfConfigurer(),
+                        SslCxfConfigurer.create(sslContextParameters, getCamelContext()))
+                .addChild(HostnameVerifierCxfConfigurer.create(hostnameVerifier));
     }
 
-    private CxfEndpointConfigurer getNullSafeCxfEndpointConfigurer() {
-        if (cxfEndpointConfigurer == null) {
-            return new ChainedCxfEndpointConfigurer.NullCxfEndpointConfigurer();
+    private CxfConfigurer getNullSafeCxfConfigurer() {
+        if (cxfConfigurer == null) {
+            return new ChainedCxfConfigurer.NullCxfConfigurer();
         } else {
-            return cxfEndpointConfigurer;
+            return cxfConfigurer;
         }
     }
 
@@ -1356,7 +1342,7 @@ public class CxfEndpoint extends DefaultEndpoint implements AsyncEndpoint, Heade
         this.skipFaultLogging = skipFaultLogging;
     }
 
-    public Boolean getMergeProtocolHeaders() {
+    public boolean isMergeProtocolHeaders() {
         return mergeProtocolHeaders;
     }
 
@@ -1392,16 +1378,16 @@ public class CxfEndpoint extends DefaultEndpoint implements AsyncEndpoint, Heade
         this.serviceFactoryBean = serviceFactoryBean;
     }
 
-    public CxfEndpointConfigurer getCxfEndpointConfigurer() {
-        return cxfEndpointConfigurer;
+    public CxfConfigurer getCxfConfigurer() {
+        return cxfConfigurer;
     }
 
     /**
      * This option could apply the implementation of org.apache.camel.component.cxf.CxfEndpointConfigurer which supports to configure the CXF endpoint
      * in  programmatic way. User can configure the CXF server and client by implementing configure{Server|Client} method of CxfEndpointConfigurer.
      */
-    public void setCxfEndpointConfigurer(CxfEndpointConfigurer configurer) {
-        this.cxfEndpointConfigurer = configurer;
+    public void setCxfConfigurer(CxfConfigurer configurer) {
+        this.cxfConfigurer = configurer;
     }
 
     public long getContinuationTimeout() {
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpointUtils.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpointUtils.java
index 0e5efd5..14246ef 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpointUtils.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpointUtils.java
@@ -56,32 +56,28 @@ public final class CxfEndpointUtils {
 
     // only used by test currently
     public static QName getPortName(final CxfEndpoint endpoint) {
-        if (endpoint.getPortName() != null) {
-            return endpoint.getPortName();
-        } else {
+        QName answer = endpoint.getPortNameAsQName();
+        if (answer == null) {
             String portLocalName = getCxfEndpointPropertyValue((CxfSpringEndpoint)endpoint, CxfConstants.PORT_LOCALNAME);
             String portNamespace = getCxfEndpointPropertyValue((CxfSpringEndpoint)endpoint, CxfConstants.PORT_NAMESPACE);
             if (portLocalName != null) {
-                return new QName(portNamespace, portLocalName);
-            } else {
-                return null;
-            }           
+                answer = new QName(portNamespace, portLocalName);
+            }
         }
+        return answer;
     }
 
     // only used by test currently
     public static QName getServiceName(final CxfEndpoint endpoint) {
-        if (endpoint.getServiceName() != null) {
-            return endpoint.getServiceName();
-        } else {
+        QName answer = endpoint.getServiceNameAsQName();
+        if (answer == null) {
             String serviceLocalName = getCxfEndpointPropertyValue((CxfSpringEndpoint)endpoint, CxfConstants.SERVICE_LOCALNAME);
             String serviceNamespace = getCxfEndpointPropertyValue((CxfSpringEndpoint)endpoint, CxfConstants.SERVICE_NAMESPACE);
             if (serviceLocalName != null) {
-                return new QName(serviceNamespace, serviceLocalName);
-            } else {
-                return null;
+                answer = new QName(serviceNamespace, serviceLocalName);
             }
         }
+        return answer;
     }
 
     public static boolean hasWebServiceAnnotation(Class<?> cls) {
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
index 3e0aff8..2c350a8 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
@@ -79,7 +79,7 @@ public class CxfProducer extends DefaultAsyncProducer {
         }
 
 
-        endpoint.getChainedCxfEndpointConfigurer().configureClient(client);
+        endpoint.getChainedCxfConfigurer().configureClient(client);
     }
 
     @Override
@@ -190,7 +190,7 @@ public class CxfProducer extends DefaultAsyncProducer {
         camelExchange.setProperty(CxfConstants.DATA_FORMAT_PROPERTY, dataFormat);   
         log.trace("Set Camel Exchange property: {}={}", DataFormat.class.getName(), dataFormat);
         
-        if (endpoint.getMergeProtocolHeaders()) {
+        if (endpoint.isMergeProtocolHeaders()) {
             camelExchange.setProperty(CxfConstants.CAMEL_CXF_PROTOCOL_HEADERS_MERGED, Boolean.TRUE);
         }
         
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSpringEndpoint.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSpringEndpoint.java
index 90890b2..1186787 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSpringEndpoint.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSpringEndpoint.java
@@ -177,16 +177,16 @@ public class CxfSpringEndpoint extends CxfEndpoint implements ApplicationContext
     }
     
     public void setServiceNamespace(String serviceNamespace) {
-        QName qn = getServiceName();
+        QName qn = getServiceNameAsQName();
         if (qn == null) {
-            setServiceName(new QName(serviceNamespace, "local"));
+            setServiceNameAsQName(new QName(serviceNamespace, "local"));
         } else {
-            setServiceName(new QName(serviceNamespace, qn.getLocalPart()));
+            setServiceNameAsQName(new QName(serviceNamespace, qn.getLocalPart()));
         }
     }
 
     public String getServiceNamespace() {
-        QName qn = getServiceName();
+        QName qn = getServiceNameAsQName();
         if (qn == null) {
             return null;
         }
@@ -194,16 +194,16 @@ public class CxfSpringEndpoint extends CxfEndpoint implements ApplicationContext
     }
 
     public void setServiceLocalName(String serviceLocalName) {
-        QName qn = getServiceName();
+        QName qn = getServiceNameAsQName();
         if (qn == null) {
-            setServiceName(new QName("", serviceLocalName));
+            setServiceNameAsQName(new QName("", serviceLocalName));
         } else {
-            setServiceName(new QName(qn.getNamespaceURI(), serviceLocalName));
+            setServiceNameAsQName(new QName(qn.getNamespaceURI(), serviceLocalName));
         }
     }
 
     public String getServiceLocalName() {
-        QName qn = getServiceName();
+        QName qn = getServiceNameAsQName();
         if (qn == null) {
             return null;
         }
@@ -211,7 +211,7 @@ public class CxfSpringEndpoint extends CxfEndpoint implements ApplicationContext
     }
 
     public String getEndpointLocalName() {
-        QName qn = getPortName();
+        QName qn = getPortNameAsQName();
         if (qn == null) {
             return null;
         }
@@ -219,25 +219,25 @@ public class CxfSpringEndpoint extends CxfEndpoint implements ApplicationContext
     }
 
     public void setEndpointLocalName(String endpointLocalName) {
-        QName qn = getPortName();
+        QName qn = getPortNameAsQName();
         if (qn == null) {
-            setPortName(new QName("", endpointLocalName));
+            setPortNameAsQName(new QName("", endpointLocalName));
         } else {
-            setPortName(new QName(qn.getNamespaceURI(), endpointLocalName));
+            setPortNameAsQName(new QName(qn.getNamespaceURI(), endpointLocalName));
         }
     }
 
     public void setEndpointNamespace(String endpointNamespace) {
-        QName qn = getPortName();
+        QName qn = getPortNameAsQName();
         if (qn == null) {
-            setPortName(new QName(endpointNamespace, "local"));
+            setPortNameAsQName(new QName(endpointNamespace, "local"));
         } else {
-            setPortName(new QName(endpointNamespace, qn.getLocalPart()));
+            setPortNameAsQName(new QName(endpointNamespace, qn.getLocalPart()));
         }
     }
 
     public String getEndpointNamespace() {
-        QName qn = getPortName();
+        QName qn = getPortNameAsQName();
         if (qn == null) {
             return null;
         }
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/HostnameVerifierCxfEndpointConfigurer.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/HostnameVerifierCxfConfigurer.java
similarity index 77%
rename from components/camel-cxf/src/main/java/org/apache/camel/component/cxf/HostnameVerifierCxfEndpointConfigurer.java
rename to components/camel-cxf/src/main/java/org/apache/camel/component/cxf/HostnameVerifierCxfConfigurer.java
index 0c60d5e..849776f 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/HostnameVerifierCxfEndpointConfigurer.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/HostnameVerifierCxfConfigurer.java
@@ -24,17 +24,17 @@ import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory;
 import org.apache.cxf.transport.http.HTTPConduit;
 
-public final class HostnameVerifierCxfEndpointConfigurer extends AbstractHostnameVerifierEndpointConfigurer implements CxfEndpointConfigurer {
+public final class HostnameVerifierCxfConfigurer extends AbstractHostnameVerifierEndpointConfigurer implements CxfConfigurer {
 
-    private HostnameVerifierCxfEndpointConfigurer(HostnameVerifier hostnameVerifier) {
+    private HostnameVerifierCxfConfigurer(HostnameVerifier hostnameVerifier) {
         super(hostnameVerifier);
     }
 
-    public static CxfEndpointConfigurer create(HostnameVerifier hostnameVerifier) {
+    public static CxfConfigurer create(HostnameVerifier hostnameVerifier) {
         if (hostnameVerifier == null) {
-            return new ChainedCxfEndpointConfigurer.NullCxfEndpointConfigurer();
+            return new ChainedCxfConfigurer.NullCxfConfigurer();
         } else {
-            return new HostnameVerifierCxfEndpointConfigurer(hostnameVerifier);
+            return new HostnameVerifierCxfConfigurer(hostnameVerifier);
         }
     }
     @Override
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/SslCxfEndpointConfigurer.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/SslCxfConfigurer.java
similarity index 75%
rename from components/camel-cxf/src/main/java/org/apache/camel/component/cxf/SslCxfEndpointConfigurer.java
rename to components/camel-cxf/src/main/java/org/apache/camel/component/cxf/SslCxfConfigurer.java
index e13f787..c4ca41b 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/SslCxfEndpointConfigurer.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/SslCxfConfigurer.java
@@ -24,18 +24,18 @@ import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory;
 import org.apache.cxf.transport.http.HTTPConduit;
 
-public final class SslCxfEndpointConfigurer extends AbstractSslEndpointConfigurer implements CxfEndpointConfigurer {
+public final class SslCxfConfigurer extends AbstractSslEndpointConfigurer implements CxfConfigurer {
 
-    private SslCxfEndpointConfigurer(SSLContextParameters sslContextParameters,
-                                     CamelContext camelContext) {
+    private SslCxfConfigurer(SSLContextParameters sslContextParameters,
+                             CamelContext camelContext) {
         super(sslContextParameters, camelContext);
     }
 
-    public static CxfEndpointConfigurer create(SSLContextParameters sslContextParameters, CamelContext camelContext) {
+    public static CxfConfigurer create(SSLContextParameters sslContextParameters, CamelContext camelContext) {
         if (sslContextParameters == null) {
-            return new ChainedCxfEndpointConfigurer.NullCxfEndpointConfigurer();
+            return new ChainedCxfConfigurer.NullCxfConfigurer();
         } else {
-            return new SslCxfEndpointConfigurer(sslContextParameters, camelContext);
+            return new SslCxfConfigurer(sslContextParameters, camelContext);
         }
     }
 
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/ChainedCxfRsEndpointConfigurer.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/ChainedCxfRsConfigurer.java
similarity index 71%
rename from components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/ChainedCxfRsEndpointConfigurer.java
rename to components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/ChainedCxfRsConfigurer.java
index 9ca3954..642b784 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/ChainedCxfRsEndpointConfigurer.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/ChainedCxfRsConfigurer.java
@@ -20,23 +20,23 @@ import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean;
 import org.apache.cxf.jaxrs.client.Client;
 
-public final class ChainedCxfRsEndpointConfigurer implements CxfRsEndpointConfigurer {
-    private CxfRsEndpointConfigurer parent;
-    private CxfRsEndpointConfigurer child;
+public final class ChainedCxfRsConfigurer implements CxfRsConfigurer {
+    private CxfRsConfigurer parent;
+    private CxfRsConfigurer child;
 
-    private ChainedCxfRsEndpointConfigurer() {
+    private ChainedCxfRsConfigurer() {
     }
 
-    public static ChainedCxfRsEndpointConfigurer create(CxfRsEndpointConfigurer parent,
-                                                        CxfRsEndpointConfigurer child) {
-        ChainedCxfRsEndpointConfigurer result = new ChainedCxfRsEndpointConfigurer();
+    public static ChainedCxfRsConfigurer create(CxfRsConfigurer parent,
+                                                CxfRsConfigurer child) {
+        ChainedCxfRsConfigurer result = new ChainedCxfRsConfigurer();
         result.parent = parent;
         result.child = child;
         return result;
     }
 
-    public ChainedCxfRsEndpointConfigurer addChild(CxfRsEndpointConfigurer cxfEndpointConfigurer) {
-        ChainedCxfRsEndpointConfigurer result = new ChainedCxfRsEndpointConfigurer();
+    public ChainedCxfRsConfigurer addChild(CxfRsConfigurer cxfEndpointConfigurer) {
+        ChainedCxfRsConfigurer result = new ChainedCxfRsConfigurer();
         result.parent = this;
         result.child = cxfEndpointConfigurer;
         return result;
@@ -60,7 +60,7 @@ public final class ChainedCxfRsEndpointConfigurer implements CxfRsEndpointConfig
         child.configureServer(server);
     }
 
-    public static class NullCxfRsEndpointConfigurer implements CxfRsEndpointConfigurer {
+    public static class NullCxfRsConfigurer implements CxfRsConfigurer {
 
         @Override
         public void configure(AbstractJAXRSFactoryBean factoryBean) {
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointConfigurer.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsConfigurer.java
similarity index 90%
rename from components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointConfigurer.java
rename to components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsConfigurer.java
index d2759ef..fe3cf7e 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointConfigurer.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsConfigurer.java
@@ -21,13 +21,14 @@ import org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean;
 import org.apache.cxf.jaxrs.client.Client;
 
 /**
- * A pluggable strategy for configuring the cxfRsEndpoint by using java code
+ * A pluggable strategy for configuring the Camel CXF RS by using java code
  */
-public interface CxfRsEndpointConfigurer {
+public interface CxfRsConfigurer {
     
     /**
      * Configure the CXF-RS Server/Client factory bean
-     * @param factoryBean
+     *
+     * @param factoryBean the factory bean
      */
     void configure(AbstractJAXRSFactoryBean factoryBean);
     
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
index 8fa976e..84f1331 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
@@ -84,7 +84,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
     @UriParam
     private List<Class<?>> resourceClasses;
     @UriParam(label = "consumer,advanced")
-    private List<Object> serviceBeans;
+    private String serviceBeans;
     @UriParam
     private String modelRef;
     @UriParam(label = "consumer", defaultValue = "Default")
@@ -129,7 +129,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
     @UriParam(label = "advanced")
     private boolean propagateContexts;
     @UriParam(label = "advanced")
-    private CxfRsEndpointConfigurer cxfRsEndpointConfigurer;
+    private CxfRsConfigurer cxfRsConfigurer;
     @UriParam(label = "producer")
     private CookieHandler cookieHandler;
 
@@ -219,11 +219,11 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
         return skipFaultLogging;
     }
 
-    public CxfRsEndpointConfigurer getChainedCxfRsEndpointConfigurer() {
-        return ChainedCxfRsEndpointConfigurer
+    public CxfRsConfigurer getChainedCxfRsEndpointConfigurer() {
+        return ChainedCxfRsConfigurer
                 .create(getNullSafeCxfRsEndpointConfigurer(),
-                        SslCxfRsEndpointConfigurer.create(sslContextParameters, getCamelContext()))
-                .addChild(HostnameVerifierCxfRsEndpointConfigurer.create(hostnameVerifier));
+                        SslCxfRsConfigurer.create(sslContextParameters, getCamelContext()))
+                .addChild(HostnameVerifierCxfRsConfigurer.create(hostnameVerifier));
     }
     /**
      * This option controls whether the PhaseInterceptorChain skips logging the Fault that it catches.
@@ -247,8 +247,9 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
         if (getResourceClasses() != null) {
             sfb.setResourceClasses(getResourceClasses());
         }
-        if (serviceBeans != null && !serviceBeans.isEmpty()) {
-            sfb.setServiceBeans(serviceBeans);
+        if (serviceBeans != null) {
+            List<Object> beans = EndpointHelper.resolveReferenceListParameter(getCamelContext(), serviceBeans, Object.class);
+            sfb.setServiceBeans(beans);
         }
 
         // setup the resource providers for interfaces
@@ -264,11 +265,11 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
         getNullSafeCxfRsEndpointConfigurer().configure(sfb);
     }
 
-    protected CxfRsEndpointConfigurer getNullSafeCxfRsEndpointConfigurer() {
-        if (cxfRsEndpointConfigurer == null) {
-            return new ChainedCxfRsEndpointConfigurer.NullCxfRsEndpointConfigurer();
+    protected CxfRsConfigurer getNullSafeCxfRsEndpointConfigurer() {
+        if (cxfRsConfigurer == null) {
+            return new ChainedCxfRsConfigurer.NullCxfRsConfigurer();
         }
-        return cxfRsEndpointConfigurer;
+        return cxfRsConfigurer;
     }
 
     private void processResourceModel(JAXRSServerFactoryBean sfb) {
@@ -436,33 +437,18 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
         setResourceClasses(Arrays.asList(classes));
     }
 
-    public List<?> getServiceBeans() {
+    public String getServiceBeans() {
         return serviceBeans;
     }
 
-    public void addServiceBean(Object bean) {
-        if (serviceBeans == null) {
-            serviceBeans = new ArrayList<>();
-        }
-        serviceBeans.add(bean);
-    }
-
     /**
-     * The service beans which you want to export as REST service. Multiple beans can be separated by comma.
+     * The service beans (the bean ids to lookup in the registry) which you want to export as REST service.
+     * Multiple beans can be separated by comma
      */
-    public void setServiceBeans(List<?> beans) {
-        this.serviceBeans = new ArrayList<Object>(beans);
-    }
-
-    public void setServiceBeans(Object... beans) {
-        setServiceBeans(Arrays.asList(beans));
-    }
-
     public void setServiceBeans(String beans) {
-        setServiceBeans(EndpointHelper.resolveReferenceListParameter(getCamelContext(), beans, Object.class));
+        this.serviceBeans = beans;
     }
 
-
     /**
      * The service publish address.
      */
@@ -470,6 +456,10 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
         this.address = address;
     }
 
+    public String getModelRef() {
+        return modelRef;
+    }
+
     /**
      * This option is used to specify the model file which is useful for the resource class without annotation.
      * When using this option, then the service class can be omitted, to emulate document-only endpoints
@@ -822,16 +812,16 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
         this.hostnameVerifier = hostnameVerifier;
     }
 
-    public CxfRsEndpointConfigurer getCxfRsEndpointConfigurer() {
-        return cxfRsEndpointConfigurer;
+    public CxfRsConfigurer getCxfRsConfigurer() {
+        return cxfRsConfigurer;
     }
 
     /**
      * This option could apply the implementation of org.apache.camel.component.cxf.jaxrs.CxfRsEndpointConfigurer which supports to configure the CXF endpoint
      * in  programmatic way. User can configure the CXF server and client by implementing configure{Server/Client} method of CxfEndpointConfigurer.
      */
-    public void setCxfRsEndpointConfigurer(CxfRsEndpointConfigurer configurer) {
-        this.cxfRsEndpointConfigurer = configurer;
+    public void setCxfRsConfigurer(CxfRsConfigurer configurer) {
+        this.cxfRsConfigurer = configurer;
     }
 
     public CookieHandler getCookieHandler() {
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/HostnameVerifierCxfRsEndpointConfigurer.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/HostnameVerifierCxfRsConfigurer.java
similarity index 77%
rename from components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/HostnameVerifierCxfRsEndpointConfigurer.java
rename to components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/HostnameVerifierCxfRsConfigurer.java
index 84649ec..e6b27e6 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/HostnameVerifierCxfRsEndpointConfigurer.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/HostnameVerifierCxfRsConfigurer.java
@@ -25,17 +25,17 @@ import org.apache.cxf.jaxrs.client.Client;
 import org.apache.cxf.jaxrs.client.WebClient;
 import org.apache.cxf.transport.http.HTTPConduit;
 
-public final class HostnameVerifierCxfRsEndpointConfigurer extends AbstractHostnameVerifierEndpointConfigurer implements CxfRsEndpointConfigurer {
+public final class HostnameVerifierCxfRsConfigurer extends AbstractHostnameVerifierEndpointConfigurer implements CxfRsConfigurer {
 
-    private HostnameVerifierCxfRsEndpointConfigurer(HostnameVerifier hostnameVerifier) {
+    private HostnameVerifierCxfRsConfigurer(HostnameVerifier hostnameVerifier) {
         super(hostnameVerifier);
     }
 
-    public static CxfRsEndpointConfigurer create(HostnameVerifier hostnameVerifier) {
+    public static CxfRsConfigurer create(HostnameVerifier hostnameVerifier) {
         if (hostnameVerifier == null) {
-            return new ChainedCxfRsEndpointConfigurer.NullCxfRsEndpointConfigurer();
+            return new ChainedCxfRsConfigurer.NullCxfRsConfigurer();
         } else {
-            return new HostnameVerifierCxfRsEndpointConfigurer(hostnameVerifier);
+            return new HostnameVerifierCxfRsConfigurer(hostnameVerifier);
         }
     }
     @Override
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/SslCxfRsEndpointConfigurer.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/SslCxfRsConfigurer.java
similarity index 75%
rename from components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/SslCxfRsEndpointConfigurer.java
rename to components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/SslCxfRsConfigurer.java
index b3ec4e9..0f11fa6 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/SslCxfRsEndpointConfigurer.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/SslCxfRsConfigurer.java
@@ -25,18 +25,18 @@ import org.apache.cxf.jaxrs.client.Client;
 import org.apache.cxf.jaxrs.client.WebClient;
 import org.apache.cxf.transport.http.HTTPConduit;
 
-public final class SslCxfRsEndpointConfigurer extends AbstractSslEndpointConfigurer implements CxfRsEndpointConfigurer {
+public final class SslCxfRsConfigurer extends AbstractSslEndpointConfigurer implements CxfRsConfigurer {
 
-    private SslCxfRsEndpointConfigurer(SSLContextParameters sslContextParameters,
-                                       CamelContext camelContext) {
+    private SslCxfRsConfigurer(SSLContextParameters sslContextParameters,
+                               CamelContext camelContext) {
         super(sslContextParameters, camelContext);
     }
 
-    public static CxfRsEndpointConfigurer create(SSLContextParameters sslContextParameters, CamelContext camelContext) {
+    public static CxfRsConfigurer create(SSLContextParameters sslContextParameters, CamelContext camelContext) {
         if (sslContextParameters == null) {
-            return new ChainedCxfRsEndpointConfigurer.NullCxfRsEndpointConfigurer();
+            return new ChainedCxfRsConfigurer.NullCxfRsConfigurer();
         } else {
-            return new SslCxfRsEndpointConfigurer(sslContextParameters, camelContext);
+            return new SslCxfRsConfigurer(sslContextParameters, camelContext);
         }
     }
 
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanDefinitionParser.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanDefinitionParser.java
index 5dd3d9d..10415fd 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanDefinitionParser.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanDefinitionParser.java
@@ -61,10 +61,10 @@ public class CxfEndpointBeanDefinitionParser extends AbstractCxfBeanDefinitionPa
         if ("endpointName".equals(name) || "serviceName".equals(name)) {
             if (isSpringPlaceHolder(val)) {
                 // set the property with the String value directly
-                mapToProperty(bean, name + "String", val);
+                mapToProperty(bean, name, val);
             } else {
                 QName q = parseQName(e, val);
-                bean.addPropertyValue(name, q);
+                bean.addPropertyValue(name + "AsQName", q);
             }
         } else {
             mapToProperty(bean, name, val);
diff --git a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfEndpointTest.java b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfEndpointTest.java
index d499155..9826f89 100644
--- a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfEndpointTest.java
+++ b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfEndpointTest.java
@@ -100,12 +100,12 @@ public class CxfEndpointTest extends Assert {
     @Test
     public void testCxfEndpointConfigurer() throws Exception {
         SimpleRegistry registry = new SimpleRegistry();
-        CxfEndpointConfigurer configurer = mock(CxfEndpointConfigurer.class);
+        CxfConfigurer configurer = mock(CxfConfigurer.class);
         Processor processor = mock(Processor.class);
         registry.bind("myConfigurer", configurer);
         CamelContext camelContext = new DefaultCamelContext(registry);
         CxfComponent cxfComponent = new CxfComponent(camelContext);
-        CxfEndpoint endpoint = (CxfEndpoint)cxfComponent.createEndpoint(routerEndpointURI + "&cxfEndpointConfigurer=#myConfigurer");
+        CxfEndpoint endpoint = (CxfEndpoint)cxfComponent.createEndpoint(routerEndpointURI + "&cxfConfigurer=#myConfigurer");
 
         Consumer consumer = endpoint.createConsumer(processor);
         consumer.start();
diff --git a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfJavaOnlyCamelContextAwareTest.java b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfJavaOnlyCamelContextAwareTest.java
index b6c248f..57b7d5c 100644
--- a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfJavaOnlyCamelContextAwareTest.java
+++ b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfJavaOnlyCamelContextAwareTest.java
@@ -65,8 +65,8 @@ public class CxfJavaOnlyCamelContextAwareTest extends CamelTestSupport {
             public void configure() throws Exception {
                 CxfEndpoint endpoint = new CxfEndpoint();
                 endpoint.setAddress("http://localhost:" + port1 + "/PersonService");
-                endpoint.setServiceName(new QName("http://camel.apache.org/wsdl-first", "PersonService"));
-                endpoint.setPortName(new QName("http://camel.apache.org/wsdl-first", "soap"));
+                endpoint.setServiceNameAsQName(new QName("http://camel.apache.org/wsdl-first", "PersonService"));
+                endpoint.setPortNameAsQName(new QName("http://camel.apache.org/wsdl-first", "soap"));
                 endpoint.setWsdlURL("classpath:person.wsdl");
                 endpoint.setDataFormat(DataFormat.PAYLOAD);
                 context.addEndpoint("personService", endpoint);
diff --git a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfTimeoutTest.java b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfTimeoutTest.java
index 31783b8..9670b36 100644
--- a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfTimeoutTest.java
+++ b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfTimeoutTest.java
@@ -24,7 +24,6 @@ import javax.xml.ws.Endpoint;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.component.cxf.common.message.CxfConstants;
-import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.spring.CamelSpringTestSupport;
 import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.endpoint.Server;
@@ -72,7 +71,7 @@ public class CxfTimeoutTest extends CamelSpringTestSupport {
     
     @Test
     public void testInvokingJaxWsServerWithCxfEndpointWithConfigurer() throws Exception {
-        Exchange reply = sendJaxWsMessage("cxf://bean:springEndpoint?cxfEndpointConfigurer=#myConfigurer");
+        Exchange reply = sendJaxWsMessage("cxf://bean:springEndpoint?cxfConfigurer=#myConfigurer");
         // we don't expect the exception here
         assertFalse("We don't expect the exception here", reply.isFailed());
         assertEquals("Get a wrong response", "Greet Hello World!", reply.getOut().getBody(String.class));
@@ -113,7 +112,7 @@ public class CxfTimeoutTest extends CamelSpringTestSupport {
         return new ClassPathXmlApplicationContext("org/apache/camel/component/cxf/cxfConduitTimeOutContext.xml");
     }
     
-    public static class MyCxfEndpointConfigurer implements CxfEndpointConfigurer {
+    public static class MyCxfConfigurer implements CxfConfigurer {
 
         @Override
         public void configure(AbstractWSDLBasedEndpointFactory factoryBean) {
diff --git a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsConsumerTest.java b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsConsumerTest.java
index a60b9f8..9d876c3 100644
--- a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsConsumerTest.java
+++ b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsConsumerTest.java
@@ -75,11 +75,11 @@ public class CxfRsConsumerTest extends CamelTestSupport {
             + "modelRef=classpath:/org/apache/camel/component/cxf/jaxrs/CustomerServiceDefaultHandlerModel.xml";
     private static final String CXF_RS_ENDPOINT_URI6 =
             "cxfrs://http://localhost:" + CXT + "/rest6?"
-            + "performInvocation=true&serviceBeans=#serviceBean";
+            + "performInvocation=true&serviceBeans=#myServiceBean";
 
     @Override
     protected void bindToRegistry(Registry registry) throws Exception {
-        registry.bind("serviceBean", new CustomerService());
+        registry.bind("myServiceBean", new CustomerService());
     }
 
     @Override
diff --git a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerEndpointConfigurerTest.java b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerEndpointConfigurerTest.java
index 511e9be..08ceeb8 100644
--- a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerEndpointConfigurerTest.java
+++ b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerEndpointConfigurerTest.java
@@ -43,7 +43,7 @@ public class CxfRsProducerEndpointConfigurerTest extends CamelTestSupport {
                 endpoint.setCamelContext(context);
                 endpoint.setResourceClasses(CustomerService.class);
                 endpoint.setEndpointUriIfNotSpecified("cxfrs:simple");
-                endpoint.setCxfRsEndpointConfigurer(new MyCxfRsEndpointConfigurer());
+                endpoint.setCxfRsConfigurer(new MyCxfRsConfigurer());
 
                 from("direct:start")
                         .to(endpoint)
@@ -87,7 +87,7 @@ public class CxfRsProducerEndpointConfigurerTest extends CamelTestSupport {
         assertMockEndpointsSatisfied();
     }
 
-    public static class MyCxfRsEndpointConfigurer implements CxfRsEndpointConfigurer {
+    public static class MyCxfRsConfigurer implements CxfRsConfigurer {
 
         @Override
         public void configure(AbstractJAXRSFactoryBean factoryBean) {
diff --git a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanTest.java b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanTest.java
index db00c5a..1b71547 100644
--- a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanTest.java
+++ b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanTest.java
@@ -60,8 +60,8 @@ public class CxfEndpointBeanTest extends AbstractSpringBeanTestSupport {
         assertEquals("Got the wrong continuationTimeout", 60000, routerEndpoint.getContinuationTimeout());
         
         CxfEndpoint myEndpoint = ctx.getBean("myEndpoint", CxfEndpoint.class);
-        assertEquals("Got the wrong endpointName", endpointName, myEndpoint.getPortName());
-        assertEquals("Got the wrong serviceName", serviceName, myEndpoint.getServiceName());
+        assertEquals("Got the wrong endpointName", endpointName, myEndpoint.getPortNameAsQName());
+        assertEquals("Got the wrong serviceName", serviceName, myEndpoint.getServiceNameAsQName());
         assertEquals("loggingFeatureEnabled should be true", true, myEndpoint.isLoggingFeatureEnabled());
         assertEquals("loggingSizeLimit should be set", 200, myEndpoint.getLoggingSizeLimit());
         assertTrue("We should get a soap binding", myEndpoint.getBindingConfig() instanceof SoapBindingConfiguration);
diff --git a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfEndpointBeansRouterTest.java b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfEndpointBeansRouterTest.java
index 4a56804..256e16b 100644
--- a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfEndpointBeansRouterTest.java
+++ b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfEndpointBeansRouterTest.java
@@ -98,9 +98,9 @@ public class CxfEndpointBeansRouterTest extends AbstractSpringBeanTestSupport {
         assertEquals("Got a wrong address", "http://localhost:9000/testEndpoint", testEndpoint.getAddress());
         assertEquals("Got a wrong bindingId", "http://schemas.xmlsoap.org/wsdl/soap12/", testEndpoint.getBindingId());
         assertEquals("Got a wrong transportId", "http://cxf.apache.org/transports/http", testEndpoint.getTransportId());
-        assertEquals("Got a wrong endpointName", endpointName, testEndpoint.getPortName());
+        assertEquals("Got a wrong endpointName", endpointName, testEndpoint.getPortNameAsQName());
         assertEquals("Got a wrong WsdlURL", "wsdl/test.wsdl", testEndpoint.getWsdlURL());
-        assertEquals("Got a wrong serviceName", serviceName, testEndpoint.getServiceName());
+        assertEquals("Got a wrong serviceName", serviceName, testEndpoint.getServiceNameAsQName());
     }
    
 }
diff --git a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/util/CxfEndpointUtilsTest.java b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/util/CxfEndpointUtilsTest.java
index f5a7291..16ab35b 100644
--- a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/util/CxfEndpointUtilsTest.java
+++ b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/util/CxfEndpointUtilsTest.java
@@ -66,7 +66,7 @@ public class CxfEndpointUtilsTest extends Assert {
     @Test
     public void testGetProperties() throws Exception {
         CxfEndpoint endpoint = createEndpoint(getEndpointURI());
-        QName service = endpoint.getServiceName();
+        QName service = endpoint.getServiceNameAsQName();
         assertEquals("We should get the right service name", service, SERVICE_NAME);
     }
 
diff --git a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/util/CxfEndpointUtilsWithSpringTest.java b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/util/CxfEndpointUtilsWithSpringTest.java
index 015f6e3..9294fe2 100644
--- a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/util/CxfEndpointUtilsWithSpringTest.java
+++ b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/util/CxfEndpointUtilsWithSpringTest.java
@@ -82,7 +82,7 @@ public class CxfEndpointUtilsWithSpringTest extends CxfEndpointUtilsTest {
     @Test
     public void testGetProperties() throws Exception {
         CxfSpringEndpoint endpoint = (CxfSpringEndpoint)createEndpoint(getEndpointURI());
-        QName service = endpoint.getServiceName();
+        QName service = endpoint.getServiceNameAsQName();
         assertEquals("We should get the right service name", SERVICE_NAME, service);
         assertEquals("The cxf endpoint's DataFromat should be RAW", DataFormat.RAW,
                      endpoint.getDataFormat().dealias());
diff --git a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/cxfConduitTimeOutContext.xml b/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/cxfConduitTimeOutContext.xml
index d41ae82..324f65d 100644
--- a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/cxfConduitTimeOutContext.xml
+++ b/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/cxfConduitTimeOutContext.xml
@@ -47,7 +47,7 @@
     </http-conf:conduit>
 
     <!-- setup the CxfEndpointConfigurer bean here -->
-    <bean id="myConfigurer" class="org.apache.camel.component.cxf.CxfTimeoutTest$MyCxfEndpointConfigurer"/>
+    <bean id="myConfigurer" class="org.apache.camel.component.cxf.CxfTimeoutTest$MyCxfConfigurer"/>
 
     <bean id="defaultHostnameVerifier" class="org.apache.cxf.transport.https.httpclient.DefaultHostnameVerifier"/>
 
diff --git a/components/camel-ipfs/src/main/java/org/apache/camel/component/ipfs/IPFSEndpoint.java b/components/camel-ipfs/src/main/java/org/apache/camel/component/ipfs/IPFSEndpoint.java
index 1be9dec..e08f02d 100644
--- a/components/camel-ipfs/src/main/java/org/apache/camel/component/ipfs/IPFSEndpoint.java
+++ b/components/camel-ipfs/src/main/java/org/apache/camel/component/ipfs/IPFSEndpoint.java
@@ -46,7 +46,8 @@ import org.slf4j.LoggerFactory;
  * The camel-ipfs component provides access to the Interplanetary File System
  * (IPFS).
  */
-@UriEndpoint(firstVersion = "2.23.0", scheme = "ipfs", title = "IPFS", syntax = "ipfs:ipfsHost:ipfsPort/ipfsCmd", producerOnly = true, label = "file,ipfs")
+@UriEndpoint(firstVersion = "2.23.0", scheme = "ipfs", title = "IPFS",
+        syntax = "ipfs:ipfsHost:ipfsPort/ipfsCmd", producerOnly = true, label = "file,ipfs", generateConfigurer = false)
 public class IPFSEndpoint extends DefaultEndpoint {
 
     public static final long DEFAULT_TIMEOUT = 10000L;
diff --git a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/CxfEndpointBuilderFactory.java b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/CxfEndpointBuilderFactory.java
index 74367ff..20fb3b3 100644
--- a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/CxfEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/CxfEndpointBuilderFactory.java
@@ -531,14 +531,13 @@ public interface CxfEndpointBuilderFactory {
          * method of CxfEndpointConfigurer.
          * 
          * The option is a:
-         * <code>org.apache.camel.component.cxf.CxfEndpointConfigurer</code>
-         * type.
+         * <code>org.apache.camel.component.cxf.CxfConfigurer</code> type.
          * 
          * Group: advanced
          */
-        default AdvancedCxfEndpointConsumerBuilder cxfEndpointConfigurer(
-                Object cxfEndpointConfigurer) {
-            setProperty("cxfEndpointConfigurer", cxfEndpointConfigurer);
+        default AdvancedCxfEndpointConsumerBuilder cxfConfigurer(
+                Object cxfConfigurer) {
+            setProperty("cxfConfigurer", cxfConfigurer);
             return this;
         }
         /**
@@ -549,14 +548,13 @@ public interface CxfEndpointBuilderFactory {
          * method of CxfEndpointConfigurer.
          * 
          * The option will be converted to a
-         * <code>org.apache.camel.component.cxf.CxfEndpointConfigurer</code>
-         * type.
+         * <code>org.apache.camel.component.cxf.CxfConfigurer</code> type.
          * 
          * Group: advanced
          */
-        default AdvancedCxfEndpointConsumerBuilder cxfEndpointConfigurer(
-                String cxfEndpointConfigurer) {
-            setProperty("cxfEndpointConfigurer", cxfEndpointConfigurer);
+        default AdvancedCxfEndpointConsumerBuilder cxfConfigurer(
+                String cxfConfigurer) {
+            setProperty("cxfConfigurer", cxfConfigurer);
             return this;
         }
         /**
@@ -1316,14 +1314,13 @@ public interface CxfEndpointBuilderFactory {
          * method of CxfEndpointConfigurer.
          * 
          * The option is a:
-         * <code>org.apache.camel.component.cxf.CxfEndpointConfigurer</code>
-         * type.
+         * <code>org.apache.camel.component.cxf.CxfConfigurer</code> type.
          * 
          * Group: advanced
          */
-        default AdvancedCxfEndpointProducerBuilder cxfEndpointConfigurer(
-                Object cxfEndpointConfigurer) {
-            setProperty("cxfEndpointConfigurer", cxfEndpointConfigurer);
+        default AdvancedCxfEndpointProducerBuilder cxfConfigurer(
+                Object cxfConfigurer) {
+            setProperty("cxfConfigurer", cxfConfigurer);
             return this;
         }
         /**
@@ -1334,14 +1331,13 @@ public interface CxfEndpointBuilderFactory {
          * method of CxfEndpointConfigurer.
          * 
          * The option will be converted to a
-         * <code>org.apache.camel.component.cxf.CxfEndpointConfigurer</code>
-         * type.
+         * <code>org.apache.camel.component.cxf.CxfConfigurer</code> type.
          * 
          * Group: advanced
          */
-        default AdvancedCxfEndpointProducerBuilder cxfEndpointConfigurer(
-                String cxfEndpointConfigurer) {
-            setProperty("cxfEndpointConfigurer", cxfEndpointConfigurer);
+        default AdvancedCxfEndpointProducerBuilder cxfConfigurer(
+                String cxfConfigurer) {
+            setProperty("cxfConfigurer", cxfConfigurer);
             return this;
         }
         /**
@@ -1928,14 +1924,12 @@ public interface CxfEndpointBuilderFactory {
          * method of CxfEndpointConfigurer.
          * 
          * The option is a:
-         * <code>org.apache.camel.component.cxf.CxfEndpointConfigurer</code>
-         * type.
+         * <code>org.apache.camel.component.cxf.CxfConfigurer</code> type.
          * 
          * Group: advanced
          */
-        default AdvancedCxfEndpointBuilder cxfEndpointConfigurer(
-                Object cxfEndpointConfigurer) {
-            setProperty("cxfEndpointConfigurer", cxfEndpointConfigurer);
+        default AdvancedCxfEndpointBuilder cxfConfigurer(Object cxfConfigurer) {
+            setProperty("cxfConfigurer", cxfConfigurer);
             return this;
         }
         /**
@@ -1946,14 +1940,12 @@ public interface CxfEndpointBuilderFactory {
          * method of CxfEndpointConfigurer.
          * 
          * The option will be converted to a
-         * <code>org.apache.camel.component.cxf.CxfEndpointConfigurer</code>
-         * type.
+         * <code>org.apache.camel.component.cxf.CxfConfigurer</code> type.
          * 
          * Group: advanced
          */
-        default AdvancedCxfEndpointBuilder cxfEndpointConfigurer(
-                String cxfEndpointConfigurer) {
-            setProperty("cxfEndpointConfigurer", cxfEndpointConfigurer);
+        default AdvancedCxfEndpointBuilder cxfConfigurer(String cxfConfigurer) {
+            setProperty("cxfConfigurer", cxfConfigurer);
             return this;
         }
         /**
diff --git a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/CxfRsEndpointBuilderFactory.java b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/CxfRsEndpointBuilderFactory.java
index 52844df..29deac8 100644
--- a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/CxfRsEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/CxfRsEndpointBuilderFactory.java
@@ -415,25 +415,11 @@ public interface CxfRsEndpointBuilderFactory {
             return this;
         }
         /**
-         * The service beans which you want to export as REST service. Multiple
-         * beans can be separated by comma.
+         * The service beans (the bean ids to lookup in the registry) which you
+         * want to export as REST service. Multiple beans can be separated by
+         * comma.
          * 
-         * The option is a: <code>java.util.List&lt;java.lang.Object&gt;</code>
-         * type.
-         * 
-         * Group: consumer (advanced)
-         */
-        default AdvancedCxfRsEndpointConsumerBuilder serviceBeans(
-                List<Object> serviceBeans) {
-            setProperty("serviceBeans", serviceBeans);
-            return this;
-        }
-        /**
-         * The service beans which you want to export as REST service. Multiple
-         * beans can be separated by comma.
-         * 
-         * The option will be converted to a
-         * <code>java.util.List&lt;java.lang.Object&gt;</code> type.
+         * The option is a: <code>java.lang.String</code> type.
          * 
          * Group: consumer (advanced)
          */
@@ -553,13 +539,14 @@ public interface CxfRsEndpointBuilderFactory {
          * configure{Server/Client} method of CxfEndpointConfigurer.
          * 
          * The option is a:
-         * <code>org.apache.camel.component.cxf.jaxrs.CxfRsEndpointConfigurer</code> type.
+         * <code>org.apache.camel.component.cxf.jaxrs.CxfRsConfigurer</code>
+         * type.
          * 
          * Group: advanced
          */
-        default AdvancedCxfRsEndpointConsumerBuilder cxfRsEndpointConfigurer(
-                Object cxfRsEndpointConfigurer) {
-            setProperty("cxfRsEndpointConfigurer", cxfRsEndpointConfigurer);
+        default AdvancedCxfRsEndpointConsumerBuilder cxfRsConfigurer(
+                Object cxfRsConfigurer) {
+            setProperty("cxfRsConfigurer", cxfRsConfigurer);
             return this;
         }
         /**
@@ -570,13 +557,14 @@ public interface CxfRsEndpointBuilderFactory {
          * configure{Server/Client} method of CxfEndpointConfigurer.
          * 
          * The option will be converted to a
-         * <code>org.apache.camel.component.cxf.jaxrs.CxfRsEndpointConfigurer</code> type.
+         * <code>org.apache.camel.component.cxf.jaxrs.CxfRsConfigurer</code>
+         * type.
          * 
          * Group: advanced
          */
-        default AdvancedCxfRsEndpointConsumerBuilder cxfRsEndpointConfigurer(
-                String cxfRsEndpointConfigurer) {
-            setProperty("cxfRsEndpointConfigurer", cxfRsEndpointConfigurer);
+        default AdvancedCxfRsEndpointConsumerBuilder cxfRsConfigurer(
+                String cxfRsConfigurer) {
+            setProperty("cxfRsConfigurer", cxfRsConfigurer);
             return this;
         }
         /**
@@ -1276,13 +1264,14 @@ public interface CxfRsEndpointBuilderFactory {
          * configure{Server/Client} method of CxfEndpointConfigurer.
          * 
          * The option is a:
-         * <code>org.apache.camel.component.cxf.jaxrs.CxfRsEndpointConfigurer</code> type.
+         * <code>org.apache.camel.component.cxf.jaxrs.CxfRsConfigurer</code>
+         * type.
          * 
          * Group: advanced
          */
-        default AdvancedCxfRsEndpointProducerBuilder cxfRsEndpointConfigurer(
-                Object cxfRsEndpointConfigurer) {
-            setProperty("cxfRsEndpointConfigurer", cxfRsEndpointConfigurer);
+        default AdvancedCxfRsEndpointProducerBuilder cxfRsConfigurer(
+                Object cxfRsConfigurer) {
+            setProperty("cxfRsConfigurer", cxfRsConfigurer);
             return this;
         }
         /**
@@ -1293,13 +1282,14 @@ public interface CxfRsEndpointBuilderFactory {
          * configure{Server/Client} method of CxfEndpointConfigurer.
          * 
          * The option will be converted to a
-         * <code>org.apache.camel.component.cxf.jaxrs.CxfRsEndpointConfigurer</code> type.
+         * <code>org.apache.camel.component.cxf.jaxrs.CxfRsConfigurer</code>
+         * type.
          * 
          * Group: advanced
          */
-        default AdvancedCxfRsEndpointProducerBuilder cxfRsEndpointConfigurer(
-                String cxfRsEndpointConfigurer) {
-            setProperty("cxfRsEndpointConfigurer", cxfRsEndpointConfigurer);
+        default AdvancedCxfRsEndpointProducerBuilder cxfRsConfigurer(
+                String cxfRsConfigurer) {
+            setProperty("cxfRsConfigurer", cxfRsConfigurer);
             return this;
         }
         /**
@@ -1766,13 +1756,14 @@ public interface CxfRsEndpointBuilderFactory {
          * configure{Server/Client} method of CxfEndpointConfigurer.
          * 
          * The option is a:
-         * <code>org.apache.camel.component.cxf.jaxrs.CxfRsEndpointConfigurer</code> type.
+         * <code>org.apache.camel.component.cxf.jaxrs.CxfRsConfigurer</code>
+         * type.
          * 
          * Group: advanced
          */
-        default AdvancedCxfRsEndpointBuilder cxfRsEndpointConfigurer(
-                Object cxfRsEndpointConfigurer) {
-            setProperty("cxfRsEndpointConfigurer", cxfRsEndpointConfigurer);
+        default AdvancedCxfRsEndpointBuilder cxfRsConfigurer(
+                Object cxfRsConfigurer) {
+            setProperty("cxfRsConfigurer", cxfRsConfigurer);
             return this;
         }
         /**
@@ -1783,13 +1774,14 @@ public interface CxfRsEndpointBuilderFactory {
          * configure{Server/Client} method of CxfEndpointConfigurer.
          * 
          * The option will be converted to a
-         * <code>org.apache.camel.component.cxf.jaxrs.CxfRsEndpointConfigurer</code> type.
+         * <code>org.apache.camel.component.cxf.jaxrs.CxfRsConfigurer</code>
+         * type.
          * 
          * Group: advanced
          */
-        default AdvancedCxfRsEndpointBuilder cxfRsEndpointConfigurer(
-                String cxfRsEndpointConfigurer) {
-            setProperty("cxfRsEndpointConfigurer", cxfRsEndpointConfigurer);
+        default AdvancedCxfRsEndpointBuilder cxfRsConfigurer(
+                String cxfRsConfigurer) {
+            setProperty("cxfRsConfigurer", cxfRsConfigurer);
             return this;
         }
         /**
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java b/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
index 4a43e24..a7a8c79 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
@@ -466,21 +466,7 @@ public final class PropertyBindingSupport {
                 String key = entry.getKey();
                 Object value = entry.getValue();
                 if (writeProperties.containsKey(key)) {
-
-                    // support reference parameters
-                    if (value instanceof String) {
-                        String text = (String) value;
-                        if (isReferenceParameter(text)) {
-                            if (text.startsWith("#bean:")) {
-                                text = text.substring(6);
-                            } else {
-                                text = text.substring(1);
-                            }
-                            value = CamelContextHelper.mandatoryLookup(camelContext, text);
-                        }
-                    }
-                    // TODO: that thing with boolean and from string value true|false
-
+                    // TODO: that thing with boolean and from string value true|false (should be in EndpointPropertyConfigurerSupport)
                     writeProperties.get(key).accept(value);
                     if (removeParameter) {
                         iter.remove();
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/component/EndpointPropertyConfigurerSupport.java b/core/camel-support/src/main/java/org/apache/camel/support/component/EndpointPropertyConfigurerSupport.java
new file mode 100644
index 0000000..e9e9f6e
--- /dev/null
+++ b/core/camel-support/src/main/java/org/apache/camel/support/component/EndpointPropertyConfigurerSupport.java
@@ -0,0 +1,41 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.support.component;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.spi.EndpointPropertyConfigurer;
+
+public abstract class EndpointPropertyConfigurerSupport implements EndpointPropertyConfigurer {
+
+    public static <T> T property(CamelContext camelContext, Class<T> type, Object value) {
+        // if the type is not string based and the value is a bean reference, then we need to lookup
+        // the bean from the registry
+        if (value instanceof String && String.class != type) {
+            // is it a reference parameter
+            String text = value.toString();
+            if (text.startsWith("#")) {
+                String ref = text.startsWith("#bean:") ? text.substring(6) : text.substring(1);
+                Object obj = camelContext.getRegistry().lookupByName(ref);
+                if (obj != null) {
+                    value = obj;
+                }
+            }
+        }
+        return camelContext.getTypeConverter().convertTo(type, value);
+    }
+
+}
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
index ba3c1ff..0e9bccb 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
@@ -173,17 +173,19 @@ public class EndpointAnnotationProcessor extends AbstractCamelAnnotationProcesso
         String json = createParameterJsonSchema(componentModel, componentOptions, endpointPaths, endpointOptions, schemes, parentData);
         writer.println(json);
 
-        TypeElement parent = findTypeElement(processingEnv, roundEnv, "org.apache.camel.spi.EndpointPropertyConfigurer");
-        String fqen = classElement.getQualifiedName().toString();
-        String pn = fqen.substring(0, fqen.lastIndexOf('.'));
-        String en = classElement.getSimpleName().toString();
-        String cn = en + "Configurer";
-        String fqn = pn + "." + cn;
-
-        // only generate this once for the first scheme
-        if (schemes == null || schemes[0].equals(scheme)) {
-            EndpointPropertyConfigurerGenerator.generatePropertyConfigurer(processingEnv, parent, pn, cn, fqn, en, fqen, endpointOptions);
-            EndpointPropertyConfigurerGenerator.generateMetaInfConfigurer(processingEnv, componentModel.getScheme() + "-endpoint", fqn);
+        if (uriEndpoint.generateConfigurer()) {
+            TypeElement parent = findTypeElement(processingEnv, roundEnv, "org.apache.camel.support.component.EndpointPropertyConfigurerSupport");
+            String fqen = classElement.getQualifiedName().toString();
+            String pn = fqen.substring(0, fqen.lastIndexOf('.'));
+            String en = classElement.getSimpleName().toString();
+            String cn = en + "Configurer";
+            String fqn = pn + "." + cn;
+
+            // only generate this once for the first scheme
+            if (schemes == null || schemes[0].equals(scheme)) {
+                EndpointPropertyConfigurerGenerator.generatePropertyConfigurer(processingEnv, parent, pn, cn, fqn, en, fqen, endpointOptions);
+                EndpointPropertyConfigurerGenerator.generateMetaInfConfigurer(processingEnv, componentModel.getScheme() + "-endpoint", fqn);
+            }
         }
     }
 
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointPropertyConfigurerGenerator.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointPropertyConfigurerGenerator.java
index 620e5c0..0d969d5 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointPropertyConfigurerGenerator.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointPropertyConfigurerGenerator.java
@@ -59,12 +59,12 @@ public final class EndpointPropertyConfigurerGenerator {
             w.write("\n");
             w.write("import org.apache.camel.CamelContext;\n");
             w.write("import " + fqen + ";\n");
-            w.write("import org.apache.camel.spi.EndpointPropertyConfigurer;\n");
+            w.write("import org.apache.camel.support.component.EndpointPropertyConfigurerSupport;\n");
             w.write("\n");
             w.write("/**\n");
             w.write(" * Source code generated by org.apache.camel:apt\n");
             w.write(" */\n");
-            w.write("public class " + cn + " implements EndpointPropertyConfigurer {\n");
+            w.write("public class " + cn + " extends EndpointPropertyConfigurerSupport {\n");
             w.write("\n");
             w.write("    private final Map<String, Supplier<Object>> readPlaceholders = new HashMap<>(" + size + ");\n");
             w.write("    private final Map<String, Consumer<Object>> writePlaceholders = new HashMap<>(" + size + ");\n");
@@ -117,9 +117,8 @@ public final class EndpointPropertyConfigurerGenerator {
             type = type.substring(0, type.indexOf('<'));
         }
 
-        //  writePlaceholders.put("groupSize", o -> endpoint.setGroupSize(camelContext.getTypeConverter().convertTo(Integer.class, o)));
         StringBuilder sb = new StringBuilder();
-        sb.append("o -> endpoint.set").append(getOrSet).append("(camelContext.getTypeConverter().convertTo(").append(type).append(".class, o))");
+        sb.append("o -> endpoint.set").append(getOrSet).append("(property(camelContext, ").append(type).append(".class, o))");
         return sb.toString();
     }
 
diff --git a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriEndpoint.java b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriEndpoint.java
index 0ebd509..703c80d 100644
--- a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriEndpoint.java
+++ b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriEndpoint.java
@@ -154,4 +154,11 @@ public @interface UriEndpoint {
      */
     String excludeProperties() default "";
 
+    /**
+     * Generates source code for fast configuring of the endpoint properties which
+     * uses direct method invocation of getter/setters.
+     * Setting this to false will fallback to use reflection based introspection as Camel does in Camel 2.x.
+     */
+    boolean generateConfigurer() default true;
+
 }
\ No newline at end of file


[camel] 03/12: CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 8da3dbe2945d917ebbda19fe8324737784ade6a0
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Aug 20 11:02:24 2019 +0200

    CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
---
 .../camel-log/src/main/docs/log-component.adoc     |  19 +-
 .../apache/camel/component/log/LogEndpoint.java    |  11 +-
 .../camel/component/log/LogEndpointConfigurer.java |  50 ---
 .../java/org/apache/camel/CamelContextAware.java   |   3 +-
 .../src/main/java/org/apache/camel/Component.java  |  11 +
 ...rAware.java => EndpointPropertyConfigurer.java} |  13 +-
 .../java/org/apache/camel/spi/FactoryFinder.java   |  10 +
 .../apache/camel/spi/PropertyConfigurerAware.java  |  11 +-
 .../camel/impl/engine/DefaultFactoryFinder.java    |  24 +-
 .../endpoint/dsl/LogEndpointBuilderFactory.java    | 420 ---------------------
 .../org/apache/camel/support/DefaultComponent.java |  42 ++-
 .../org/apache/camel/support/DefaultEndpoint.java  |  14 +-
 .../tools/apt/EndpointAnnotationProcessor.java     |   9 +
 .../apt/EndpointPropertyConfigurerGenerator.java   | 131 +++++++
 14 files changed, 248 insertions(+), 520 deletions(-)

diff --git a/components/camel-log/src/main/docs/log-component.adoc b/components/camel-log/src/main/docs/log-component.adoc
index 23a7668..1826e98 100644
--- a/components/camel-log/src/main/docs/log-component.adoc
+++ b/components/camel-log/src/main/docs/log-component.adoc
@@ -93,7 +93,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (27 parameters):
+=== Query Parameters (10 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -109,23 +109,6 @@ with the following path and query parameters:
 | *marker* (producer) | An optional Marker name to use. |  | String
 | *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
 | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean
-| *maxChars* (formatting) | Limits the number of characters logged per line. | 10000 | int
-| *multiline* (formatting) | If enabled then each information is outputted on a newline. | false | boolean
-| *showAll* (formatting) | Quick option for turning all options on. (multiline, maxChars has to be manually set if to be used) | false | boolean
-| *showBody* (formatting) | Show the message body. | true | boolean
-| *showBodyType* (formatting) | Show the body Java type. | true | boolean
-| *showCaughtException* (formatting) | f the exchange has a caught exception, show the exception message (no stack trace).A caught exception is stored as a property on the exchange (using the key org.apache.camel.Exchange#EXCEPTION_CAUGHT and for instance a doCatch can catch exceptions. | false | boolean
-| *showException* (formatting) | If the exchange has an exception, show the exception message (no stacktrace) | false | boolean
-| *showExchangeId* (formatting) | Show the unique exchange ID. | false | boolean
-| *showExchangePattern* (formatting) | Shows the Message Exchange Pattern (or MEP for short). | true | boolean
-| *showFiles* (formatting) | If enabled Camel will output files | false | boolean
-| *showFuture* (formatting) | If enabled Camel will on Future objects wait for it to complete to obtain the payload to be logged. | false | boolean
-| *showHeaders* (formatting) | Show the message headers. | false | boolean
-| *showProperties* (formatting) | Show the exchange properties. | false | boolean
-| *showStackTrace* (formatting) | Show the stack trace, if an exchange has an exception. Only effective if one of showAll, showException or showCaughtException are enabled. | false | boolean
-| *showStreams* (formatting) | Whether Camel should show stream bodies or not (eg such as java.io.InputStream). Beware if you enable this option then you may not be able later to access the message body as the stream have already been read by this logger. To remedy this you will have to use Stream Caching. | false | boolean
-| *skipBodyLineSeparator* (formatting) | Whether to skip line separators when logging the message body.This allows to log the message body in one line, setting this option to false will preserve any line separators from the body, which then will log the body as is. | true | boolean
-| *style* (formatting) | Sets the outputs style to use. | Default | OutputStyle
 |===
 // endpoint options: END
 
diff --git a/components/camel-log/src/main/java/org/apache/camel/component/log/LogEndpoint.java b/components/camel-log/src/main/java/org/apache/camel/component/log/LogEndpoint.java
index f7119d7..b2bb66b 100644
--- a/components/camel-log/src/main/java/org/apache/camel/component/log/LogEndpoint.java
+++ b/components/camel-log/src/main/java/org/apache/camel/component/log/LogEndpoint.java
@@ -25,7 +25,6 @@ import org.apache.camel.spi.CamelLogger;
 import org.apache.camel.spi.ExchangeFormatter;
 import org.apache.camel.spi.MaskingFormatter;
 import org.apache.camel.spi.Metadata;
-import org.apache.camel.spi.PropertyConfigurer;
 import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriPath;
@@ -64,8 +63,9 @@ public class LogEndpoint extends ProcessorEndpoint {
     @UriParam
     private Long groupDelay;
     // we want to include the uri options of the DefaultExchangeFormatter
-    @UriParam(label = "advanced")
-    private DefaultExchangeFormatter exchangeFormatter;
+    // TODO: Make this correct instead of cheating
+    //@UriParam(label = "advanced")
+    //private DefaultExchangeFormatter exchangeFormatter;
     @UriParam
     private Boolean logMask;
 
@@ -82,11 +82,6 @@ public class LogEndpoint extends ProcessorEndpoint {
     }
 
     @Override
-    public PropertyConfigurer getPropertyConfigurer() {
-        return new LogEndpointConfigurer(this, getCamelContext());
-    }
-
-    @Override
     protected void doStart() throws Exception {
         if (logger == null) {
             logger = createLogger();
diff --git a/components/camel-log/src/main/java/org/apache/camel/component/log/LogEndpointConfigurer.java b/components/camel-log/src/main/java/org/apache/camel/component/log/LogEndpointConfigurer.java
deleted file mode 100644
index 206d10c..0000000
--- a/components/camel-log/src/main/java/org/apache/camel/component/log/LogEndpointConfigurer.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.log;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Consumer;
-import java.util.function.Supplier;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.spi.PropertyConfigurer;
-
-public class LogEndpointConfigurer implements PropertyConfigurer<Object> {
-
-    private final Map<String, Supplier<Object>> readPlaceholders = new HashMap<>();
-    private final Map<String, Consumer<Object>> writePlaceholders = new HashMap<>();
-
-    public LogEndpointConfigurer(final Object target, final CamelContext camelContext) {
-        final LogEndpoint endpoint = (LogEndpoint) target;
-
-        readPlaceholders.put("loggerName", endpoint::getLoggerName);
-        writePlaceholders.put("loggerName", o -> endpoint.setLoggerName(camelContext.getTypeConverter().convertTo(String.class, o)));
-        readPlaceholders.put("groupSize", endpoint::getGroupSize);
-        writePlaceholders.put("groupSize", o -> endpoint.setGroupSize(camelContext.getTypeConverter().convertTo(Integer.class, o)));
-    }
-
-    @Override
-    public Map<String, Supplier<Object>> getReadPropertyPlaceholderOptions(CamelContext camelContext) {
-        return readPlaceholders;
-    }
-
-    @Override
-    public Map<String, Consumer<Object>> getWritePropertyPlaceholderOptions(CamelContext camelContext) {
-        return writePlaceholders;
-    }
-}
diff --git a/core/camel-api/src/main/java/org/apache/camel/CamelContextAware.java b/core/camel-api/src/main/java/org/apache/camel/CamelContextAware.java
index 5f6c9c6..0fde100 100644
--- a/core/camel-api/src/main/java/org/apache/camel/CamelContextAware.java
+++ b/core/camel-api/src/main/java/org/apache/camel/CamelContextAware.java
@@ -17,8 +17,7 @@
 package org.apache.camel;
 
 /**
- * An interface to represent an object which wishes to be injected with
- * a {@link CamelContext} such as when working with Spring or Guice
+ * An interface to represent an object which wishes to be injected with the {@link CamelContext}
  */
 public interface CamelContextAware {
 
diff --git a/core/camel-api/src/main/java/org/apache/camel/Component.java b/core/camel-api/src/main/java/org/apache/camel/Component.java
index 9909f3c..e1f512b 100644
--- a/core/camel-api/src/main/java/org/apache/camel/Component.java
+++ b/core/camel-api/src/main/java/org/apache/camel/Component.java
@@ -22,6 +22,7 @@ import java.util.Map;
 import java.util.Optional;
 
 import org.apache.camel.component.extension.ComponentExtension;
+import org.apache.camel.spi.PropertyConfigurer;
 
 /**
  * A <a href="http://camel.apache.org/component.html">component</a> is
@@ -72,6 +73,16 @@ public interface Component extends CamelContextAware, Service {
     boolean useRawUri();
 
     /**
+     * Gets the endpoint {@link PropertyConfigurer}.
+     *
+     * @param  endpoint  the endpoint
+     * @return the configurer, or <tt>null</tt> if the endpoint does not support using property configurer.
+     */
+    default PropertyConfigurer getEndpointPropertyConfigurer(Object endpoint) {
+        return null;
+    }
+
+    /**
      * Gets a list of supported extensions.
      *
      * @return the list of extensions.
diff --git a/core/camel-api/src/main/java/org/apache/camel/spi/PropertyConfigurerAware.java b/core/camel-api/src/main/java/org/apache/camel/spi/EndpointPropertyConfigurer.java
similarity index 75%
copy from core/camel-api/src/main/java/org/apache/camel/spi/PropertyConfigurerAware.java
copy to core/camel-api/src/main/java/org/apache/camel/spi/EndpointPropertyConfigurer.java
index 7223e41..f0b556b 100644
--- a/core/camel-api/src/main/java/org/apache/camel/spi/PropertyConfigurerAware.java
+++ b/core/camel-api/src/main/java/org/apache/camel/spi/EndpointPropertyConfigurer.java
@@ -1,13 +1,13 @@
-/*
+/**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,8 +16,9 @@
  */
 package org.apache.camel.spi;
 
-public interface PropertyConfigurerAware {
+import org.apache.camel.CamelContext;
 
-    PropertyConfigurer getPropertyConfigurer();
+public interface EndpointPropertyConfigurer extends PropertyConfigurer<Object> {
 
+    void configure(Object endpoint, CamelContext camelContext);
 }
diff --git a/core/camel-api/src/main/java/org/apache/camel/spi/FactoryFinder.java b/core/camel-api/src/main/java/org/apache/camel/spi/FactoryFinder.java
index a6ba2aa..ddd9948 100644
--- a/core/camel-api/src/main/java/org/apache/camel/spi/FactoryFinder.java
+++ b/core/camel-api/src/main/java/org/apache/camel/spi/FactoryFinder.java
@@ -73,4 +73,14 @@ public interface FactoryFinder {
      * @return the factory class
      */
     Optional<Class<?>> findClass(String key, String propertyPrefix, Class<?> clazz);
+
+    /**
+     * Finds the optional factory class using the key to lookup.
+     *
+     * @param key is the key to add to the path to find a text file containing the factory name
+     * @param propertyPrefix prefix on key
+     * @return the factory class if found, or <tt>null</tt> if no class existed
+     */
+    Optional<Class<?>> findOptionalClass(String key, String propertyPrefix);
+
 }
diff --git a/core/camel-api/src/main/java/org/apache/camel/spi/PropertyConfigurerAware.java b/core/camel-api/src/main/java/org/apache/camel/spi/PropertyConfigurerAware.java
index 7223e41..bdd4efa 100644
--- a/core/camel-api/src/main/java/org/apache/camel/spi/PropertyConfigurerAware.java
+++ b/core/camel-api/src/main/java/org/apache/camel/spi/PropertyConfigurerAware.java
@@ -16,8 +16,17 @@
  */
 package org.apache.camel.spi;
 
+/**
+ * An interface to represent an object which is capable of configuring
+ * via {@link PropertyConfigurer}.
+ */
 public interface PropertyConfigurerAware {
 
-    PropertyConfigurer getPropertyConfigurer();
+    /**
+     * Gets the configurer.
+     *
+     * @param instance  the bean instance
+     */
+    PropertyConfigurer getPropertyConfigurer(Object instance);
 
 }
diff --git a/core/camel-base/src/main/java/org/apache/camel/impl/engine/DefaultFactoryFinder.java b/core/camel-base/src/main/java/org/apache/camel/impl/engine/DefaultFactoryFinder.java
index ae97d77..800f463 100644
--- a/core/camel-base/src/main/java/org/apache/camel/impl/engine/DefaultFactoryFinder.java
+++ b/core/camel-base/src/main/java/org/apache/camel/impl/engine/DefaultFactoryFinder.java
@@ -74,7 +74,7 @@ public class DefaultFactoryFinder implements FactoryFinder {
         Class<?> clazz = addToClassMap(classKey, () -> {
             Properties prop = doFindFactoryProperties(key);
             if (prop != null) {
-                return doNewInstance(prop, prefix).orElse(null);
+                return doNewInstance(prop, prefix, true).orElse(null);
             } else {
                 return null;
             }
@@ -88,15 +88,33 @@ public class DefaultFactoryFinder implements FactoryFinder {
         return findClass(key, propertyPrefix);
     }
 
+    @Override
+    public Optional<Class<?>> findOptionalClass(String key, String propertyPrefix) {
+        final String prefix = propertyPrefix != null ? propertyPrefix : "";
+        final String classKey = prefix + key;
+
+        Class<?> clazz = addToClassMap(classKey, () -> {
+            Properties prop = doFindFactoryProperties(key);
+            if (prop != null) {
+                return doNewInstance(prop, prefix, false).orElse(null);
+            } else {
+                return null;
+            }
+        });
+        return Optional.ofNullable(clazz);
+    }
+
     private Object doNewInstance(String key, String propertyPrefix) {
         Optional<Class<?>> clazz = findClass(key, propertyPrefix);
         return clazz.map(ObjectHelper::newInstance).orElse(null);
     }
 
-    private Optional<Class<?>> doNewInstance(Properties properties, String propertyPrefix) throws IOException {
+    private Optional<Class<?>> doNewInstance(Properties properties, String propertyPrefix, boolean mandatory) throws IOException {
         String className = properties.getProperty(propertyPrefix + "class");
-        if (className == null) {
+        if (className == null && mandatory) {
             throw new IOException("Expected property is missing: " + propertyPrefix + "class");
+        } else if (className == null) {
+            return Optional.empty();
         }
 
         Class<?> clazz = classResolver.resolveClass(className);
diff --git a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/LogEndpointBuilderFactory.java b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/LogEndpointBuilderFactory.java
index 9d85afa..7613db1 100644
--- a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/LogEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/LogEndpointBuilderFactory.java
@@ -178,416 +178,6 @@ public interface LogEndpointBuilderFactory {
             setProperty("marker", marker);
             return this;
         }
-        /**
-         * Limits the number of characters logged per line.
-         * 
-         * The option is a: <code>int</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder maxChars(int maxChars) {
-            setProperty("maxChars", maxChars);
-            return this;
-        }
-        /**
-         * Limits the number of characters logged per line.
-         * 
-         * The option will be converted to a <code>int</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder maxChars(String maxChars) {
-            setProperty("maxChars", maxChars);
-            return this;
-        }
-        /**
-         * If enabled then each information is outputted on a newline.
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder multiline(boolean multiline) {
-            setProperty("multiline", multiline);
-            return this;
-        }
-        /**
-         * If enabled then each information is outputted on a newline.
-         * 
-         * The option will be converted to a <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder multiline(String multiline) {
-            setProperty("multiline", multiline);
-            return this;
-        }
-        /**
-         * Quick option for turning all options on. (multiline, maxChars has to
-         * be manually set if to be used).
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder showAll(boolean showAll) {
-            setProperty("showAll", showAll);
-            return this;
-        }
-        /**
-         * Quick option for turning all options on. (multiline, maxChars has to
-         * be manually set if to be used).
-         * 
-         * The option will be converted to a <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder showAll(String showAll) {
-            setProperty("showAll", showAll);
-            return this;
-        }
-        /**
-         * Show the message body.
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder showBody(boolean showBody) {
-            setProperty("showBody", showBody);
-            return this;
-        }
-        /**
-         * Show the message body.
-         * 
-         * The option will be converted to a <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder showBody(String showBody) {
-            setProperty("showBody", showBody);
-            return this;
-        }
-        /**
-         * Show the body Java type.
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder showBodyType(boolean showBodyType) {
-            setProperty("showBodyType", showBodyType);
-            return this;
-        }
-        /**
-         * Show the body Java type.
-         * 
-         * The option will be converted to a <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder showBodyType(String showBodyType) {
-            setProperty("showBodyType", showBodyType);
-            return this;
-        }
-        /**
-         * f the exchange has a caught exception, show the exception message (no
-         * stack trace).A caught exception is stored as a property on the
-         * exchange (using the key org.apache.camel.Exchange#EXCEPTION_CAUGHT
-         * and for instance a doCatch can catch exceptions.
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder showCaughtException(
-                boolean showCaughtException) {
-            setProperty("showCaughtException", showCaughtException);
-            return this;
-        }
-        /**
-         * f the exchange has a caught exception, show the exception message (no
-         * stack trace).A caught exception is stored as a property on the
-         * exchange (using the key org.apache.camel.Exchange#EXCEPTION_CAUGHT
-         * and for instance a doCatch can catch exceptions.
-         * 
-         * The option will be converted to a <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder showCaughtException(
-                String showCaughtException) {
-            setProperty("showCaughtException", showCaughtException);
-            return this;
-        }
-        /**
-         * If the exchange has an exception, show the exception message (no
-         * stacktrace).
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder showException(boolean showException) {
-            setProperty("showException", showException);
-            return this;
-        }
-        /**
-         * If the exchange has an exception, show the exception message (no
-         * stacktrace).
-         * 
-         * The option will be converted to a <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder showException(String showException) {
-            setProperty("showException", showException);
-            return this;
-        }
-        /**
-         * Show the unique exchange ID.
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder showExchangeId(boolean showExchangeId) {
-            setProperty("showExchangeId", showExchangeId);
-            return this;
-        }
-        /**
-         * Show the unique exchange ID.
-         * 
-         * The option will be converted to a <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder showExchangeId(String showExchangeId) {
-            setProperty("showExchangeId", showExchangeId);
-            return this;
-        }
-        /**
-         * Shows the Message Exchange Pattern (or MEP for short).
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder showExchangePattern(
-                boolean showExchangePattern) {
-            setProperty("showExchangePattern", showExchangePattern);
-            return this;
-        }
-        /**
-         * Shows the Message Exchange Pattern (or MEP for short).
-         * 
-         * The option will be converted to a <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder showExchangePattern(
-                String showExchangePattern) {
-            setProperty("showExchangePattern", showExchangePattern);
-            return this;
-        }
-        /**
-         * If enabled Camel will output files.
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder showFiles(boolean showFiles) {
-            setProperty("showFiles", showFiles);
-            return this;
-        }
-        /**
-         * If enabled Camel will output files.
-         * 
-         * The option will be converted to a <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder showFiles(String showFiles) {
-            setProperty("showFiles", showFiles);
-            return this;
-        }
-        /**
-         * If enabled Camel will on Future objects wait for it to complete to
-         * obtain the payload to be logged.
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder showFuture(boolean showFuture) {
-            setProperty("showFuture", showFuture);
-            return this;
-        }
-        /**
-         * If enabled Camel will on Future objects wait for it to complete to
-         * obtain the payload to be logged.
-         * 
-         * The option will be converted to a <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder showFuture(String showFuture) {
-            setProperty("showFuture", showFuture);
-            return this;
-        }
-        /**
-         * Show the message headers.
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder showHeaders(boolean showHeaders) {
-            setProperty("showHeaders", showHeaders);
-            return this;
-        }
-        /**
-         * Show the message headers.
-         * 
-         * The option will be converted to a <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder showHeaders(String showHeaders) {
-            setProperty("showHeaders", showHeaders);
-            return this;
-        }
-        /**
-         * Show the exchange properties.
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder showProperties(boolean showProperties) {
-            setProperty("showProperties", showProperties);
-            return this;
-        }
-        /**
-         * Show the exchange properties.
-         * 
-         * The option will be converted to a <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder showProperties(String showProperties) {
-            setProperty("showProperties", showProperties);
-            return this;
-        }
-        /**
-         * Show the stack trace, if an exchange has an exception. Only effective
-         * if one of showAll, showException or showCaughtException are enabled.
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder showStackTrace(boolean showStackTrace) {
-            setProperty("showStackTrace", showStackTrace);
-            return this;
-        }
-        /**
-         * Show the stack trace, if an exchange has an exception. Only effective
-         * if one of showAll, showException or showCaughtException are enabled.
-         * 
-         * The option will be converted to a <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder showStackTrace(String showStackTrace) {
-            setProperty("showStackTrace", showStackTrace);
-            return this;
-        }
-        /**
-         * Whether Camel should show stream bodies or not (eg such as
-         * java.io.InputStream). Beware if you enable this option then you may
-         * not be able later to access the message body as the stream have
-         * already been read by this logger. To remedy this you will have to use
-         * Stream Caching.
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder showStreams(boolean showStreams) {
-            setProperty("showStreams", showStreams);
-            return this;
-        }
-        /**
-         * Whether Camel should show stream bodies or not (eg such as
-         * java.io.InputStream). Beware if you enable this option then you may
-         * not be able later to access the message body as the stream have
-         * already been read by this logger. To remedy this you will have to use
-         * Stream Caching.
-         * 
-         * The option will be converted to a <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder showStreams(String showStreams) {
-            setProperty("showStreams", showStreams);
-            return this;
-        }
-        /**
-         * Whether to skip line separators when logging the message body.This
-         * allows to log the message body in one line, setting this option to
-         * false will preserve any line separators from the body, which then
-         * will log the body as is.
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder skipBodyLineSeparator(
-                boolean skipBodyLineSeparator) {
-            setProperty("skipBodyLineSeparator", skipBodyLineSeparator);
-            return this;
-        }
-        /**
-         * Whether to skip line separators when logging the message body.This
-         * allows to log the message body in one line, setting this option to
-         * false will preserve any line separators from the body, which then
-         * will log the body as is.
-         * 
-         * The option will be converted to a <code>boolean</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder skipBodyLineSeparator(
-                String skipBodyLineSeparator) {
-            setProperty("skipBodyLineSeparator", skipBodyLineSeparator);
-            return this;
-        }
-        /**
-         * Sets the outputs style to use.
-         * 
-         * The option is a:
-         * <code>org.apache.camel.support.processor.DefaultExchangeFormatter$OutputStyle</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder style(OutputStyle style) {
-            setProperty("style", style);
-            return this;
-        }
-        /**
-         * Sets the outputs style to use.
-         * 
-         * The option will be converted to a
-         * <code>org.apache.camel.support.processor.DefaultExchangeFormatter$OutputStyle</code> type.
-         * 
-         * Group: formatting
-         */
-        default LogEndpointBuilder style(String style) {
-            setProperty("style", style);
-            return this;
-        }
     }
 
     /**
@@ -650,16 +240,6 @@ public interface LogEndpointBuilderFactory {
             return this;
         }
     }
-
-    /**
-     * Proxy enum for
-     * <code>org.apache.camel.support.processor.DefaultExchangeFormatter$OutputStyle</code> enum.
-     */
-    enum OutputStyle {
-        Default,
-        Tab,
-        Fixed;
-    }
     /**
      * Log (camel-log)
      * The log component logs message exchanges to the underlying logging
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java b/core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java
index 591260d..eecb64c 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java
@@ -16,6 +16,7 @@
  */
 package org.apache.camel.support;
 
+import java.lang.annotation.Annotation;
 import java.net.URI;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -31,8 +32,12 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.CamelContextAware;
 import org.apache.camel.Component;
 import org.apache.camel.Endpoint;
+import org.apache.camel.ExtendedCamelContext;
+import org.apache.camel.NoFactoryAvailableException;
 import org.apache.camel.ResolveEndpointFailedException;
 import org.apache.camel.component.extension.ComponentExtension;
+import org.apache.camel.spi.ComponentResolver;
+import org.apache.camel.spi.EndpointPropertyConfigurer;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.PropertyConfigurer;
 import org.apache.camel.spi.PropertyConfigurerAware;
@@ -52,6 +57,10 @@ public abstract class DefaultComponent extends ServiceSupport implements Compone
      */
     private static final Pattern RAW_PATTERN = Pattern.compile("RAW[({].*&&.*[)}]");
 
+    private static final String RESOURCE_PATH = "META-INF/services/org/apache/camel/component/";
+
+    private volatile Class endpointPropertyConfigurerClass;
+
     private final List<Supplier<ComponentExtension>> extensions = new ArrayList<>();
 
     private CamelContext camelContext;
@@ -320,6 +329,21 @@ public abstract class DefaultComponent extends ServiceSupport implements Compone
     }
 
     @Override
+    protected void doInit() throws Exception {
+        org.apache.camel.spi.annotations.Component ann = ObjectHelper.getAnnotation(this, org.apache.camel.spi.annotations.Component.class);
+        if (ann != null) {
+            String name = ann.value();
+            try {
+                Optional<Class<?>> clazz = getCamelContext().getExtension(ExtendedCamelContext.class).getFactoryFinder(RESOURCE_PATH)
+                        .findOptionalClass(name, "endpoint-property-configurer-");
+                clazz.ifPresent(aClass -> endpointPropertyConfigurerClass = aClass);
+            } catch (NoFactoryAvailableException e) {
+                // ignore
+            }
+        }
+    }
+
+    @Override
     protected void doStart() throws Exception {
         ObjectHelper.notNull(getCamelContext(), "camelContext");
     }
@@ -369,17 +393,29 @@ public abstract class DefaultComponent extends ServiceSupport implements Compone
                     .bind(camelContext, bean, parameters);
         } else {
             PropertyConfigurer configurer = null;
-            if (bean instanceof PropertyConfigurerAware) {
-                configurer = ((PropertyConfigurerAware) bean).getPropertyConfigurer();
+            if (bean instanceof Endpoint) {
+                configurer = getEndpointPropertyConfigurer(bean);
+            } else if (bean instanceof PropertyConfigurerAware) {
+                configurer = ((PropertyConfigurerAware) bean).getPropertyConfigurer(bean);
             }
             // use advanced binding
             PropertyBindingSupport.build().withConfigurer(configurer).bind(camelContext, bean, parameters);
         }
     }
 
+    @Override
+    public PropertyConfigurer getEndpointPropertyConfigurer(Object endpoint) {
+        EndpointPropertyConfigurer answer = null;
+        if (endpointPropertyConfigurerClass != null) {
+            answer = org.apache.camel.support.ObjectHelper.newInstance(endpointPropertyConfigurerClass, EndpointPropertyConfigurer.class);
+            answer.configure(endpoint, getCamelContext());
+        }
+        return answer;
+    }
+
     /**
      * Derived classes may wish to overload this to prevent the default introspection of URI parameters
-     * on the created Endpoint instance
+     * on the created {@link Endpoint} instance.
      */
     protected boolean useIntrospectionOnEndpoint() {
         return true;
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/DefaultEndpoint.java b/core/camel-support/src/main/java/org/apache/camel/support/DefaultEndpoint.java
index d4d502f..de7dd80 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/DefaultEndpoint.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/DefaultEndpoint.java
@@ -28,7 +28,6 @@ import org.apache.camel.Endpoint;
 import org.apache.camel.Exchange;
 import org.apache.camel.ExchangePattern;
 import org.apache.camel.PollingConsumer;
-import org.apache.camel.Producer;
 import org.apache.camel.ResolveEndpointFailedException;
 import org.apache.camel.spi.ExceptionHandler;
 import org.apache.camel.spi.HasId;
@@ -51,7 +50,7 @@ import org.apache.camel.util.URISupport;
  * model or not. The option is default <tt>false</tt> which means asynchronous
  * processing is allowed.
  */
-public abstract class DefaultEndpoint extends ServiceSupport implements Endpoint, HasId, CamelContextAware, PropertyConfigurerAware {
+public abstract class DefaultEndpoint extends ServiceSupport implements Endpoint, HasId, CamelContextAware {
 
     private final String id = EndpointHelper.createEndpointId();
     private transient String endpointUriToString;
@@ -418,19 +417,16 @@ public abstract class DefaultEndpoint extends ServiceSupport implements Endpoint
                     .bind(camelContext, bean, parameters);
         } else {
             PropertyConfigurer configurer = null;
-            if (bean instanceof PropertyConfigurerAware) {
-                configurer = ((PropertyConfigurerAware) bean).getPropertyConfigurer();
+            if (bean instanceof Endpoint) {
+                configurer = getComponent().getEndpointPropertyConfigurer(bean);
+            } else if (bean instanceof PropertyConfigurerAware) {
+                configurer = ((PropertyConfigurerAware) bean).getPropertyConfigurer(bean);
             }
             // use advanced binding
             PropertyBindingSupport.build().withConfigurer(configurer).bind(camelContext, bean, parameters);
         }
     }
 
-    @Override
-    public PropertyConfigurer getPropertyConfigurer() {
-        return null;
-    }
-
     /**
      * A factory method to lazily create the endpointUri if none is specified
      */
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
index 262cbef..e8d2f01 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
@@ -172,6 +172,15 @@ public class EndpointAnnotationProcessor extends AbstractCamelAnnotationProcesso
 
         String json = createParameterJsonSchema(componentModel, componentOptions, endpointPaths, endpointOptions, schemes, parentData);
         writer.println(json);
+
+        TypeElement parent = findTypeElement(processingEnv, roundEnv, "org.apache.camel.spi.EndpointPropertyConfigurer");
+        String fqen = classElement.getQualifiedName().toString();
+        String pn = fqen.substring(0, fqen.lastIndexOf('.'));
+        String en = classElement.getSimpleName().toString();
+        String cn = en + "Configurer";
+        String fqn = pn + "." + cn;
+
+        EndpointPropertyConfigurerGenerator.generatePropertyConfigurer(processingEnv, parent, pn, cn, fqn, en, fqen, endpointPaths, endpointOptions);
     }
 
     public String createParameterJsonSchema(ComponentModel componentModel, Set<ComponentOption> componentOptions,
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointPropertyConfigurerGenerator.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointPropertyConfigurerGenerator.java
new file mode 100644
index 0000000..fb3001a
--- /dev/null
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointPropertyConfigurerGenerator.java
@@ -0,0 +1,131 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.tools.apt;
+
+import java.io.Writer;
+import java.util.Set;
+import javax.annotation.processing.ProcessingEnvironment;
+import javax.lang.model.element.TypeElement;
+import javax.tools.Diagnostic;
+import javax.tools.JavaFileObject;
+
+import org.apache.camel.tools.apt.helper.IOHelper;
+import org.apache.camel.tools.apt.model.EndpointOption;
+import org.apache.camel.tools.apt.model.EndpointPath;
+
+import static org.apache.camel.tools.apt.AnnotationProcessorHelper.dumpExceptionToErrorFile;
+
+public final class EndpointPropertyConfigurerGenerator {
+
+    private EndpointPropertyConfigurerGenerator() {
+    }
+
+    public static void generatePropertyConfigurer(ProcessingEnvironment processingEnv, TypeElement parent,
+                                                  String pn, String cn, String fqn, String en, String fqen,
+                                                  Set<EndpointPath> paths, Set<EndpointOption> options) {
+
+        Writer w = null;
+        try {
+            JavaFileObject src = processingEnv.getFiler().createSourceFile(fqn, parent);
+            w = src.openWriter();
+
+            int size = paths.size() + options.size();
+
+            w.write("/* Generated by org.apache.camel:apt */\n");
+            w.write("package " + pn + ";\n");
+            w.write("\n");
+            w.write("import java.util.HashMap;\n");
+            w.write("import java.util.Map;\n");
+            w.write("import java.util.function.Consumer;\n");
+            w.write("import java.util.function.Supplier;\n");
+            w.write("\n");
+            w.write("import org.apache.camel.CamelContext;\n");
+            w.write("import " + fqen + ";\n");
+            w.write("import org.apache.camel.spi.EndpointPropertyConfigurer;\n");
+            w.write("\n");
+            w.write("/**\n");
+            w.write(" * Source code generated by org.apache.camel:apt\n");
+            w.write(" */\n");
+            w.write("public class " + cn + " implements EndpointPropertyConfigurer {\n");
+            w.write("\n");
+            w.write("    private final Map<String, Supplier<Object>> readPlaceholders = new HashMap<>(" + size + ");\n");
+            w.write("    private final Map<String, Consumer<Object>> writePlaceholders = new HashMap<>(" + size + ");\n");
+            w.write("\n");
+
+            // add constructor
+            w.write("    public void configure(Object object, CamelContext camelContext) {\n");
+            w.write("        " + en + " endpoint = (" + en + ") object;\n");
+            w.write("\n");
+
+            // only include string types as they are the only ones we can use for property placeholders
+            for (EndpointPath option : paths) {
+                String getOrSet = option.getName();
+                getOrSet = Character.toUpperCase(getOrSet.charAt(0)) + getOrSet.substring(1);
+                String getterLambda = getterLambda(getOrSet, option.getName(), option.getType());
+                String setterLambda = setterLambda(getOrSet, option.getName(), option.getType());
+                w.write("        readPlaceholders.put(\"" + option.getName() + "\", " + getterLambda + ");\n");
+                w.write("        writePlaceholders.put(\"" + option.getName() + "\", " + setterLambda + ");\n");
+            }
+            for (EndpointOption option : options) {
+                String getOrSet = option.getName();
+                getOrSet = Character.toUpperCase(getOrSet.charAt(0)) + getOrSet.substring(1);
+                String getterLambda = getterLambda(getOrSet, option.getName(), option.getType());
+                String setterLambda = setterLambda(getOrSet, option.getName(), option.getType());
+                w.write("        readPlaceholders.put(\"" + option.getName() + "\", " + getterLambda + ");\n");
+                w.write("        writePlaceholders.put(\"" + option.getName() + "\", " + setterLambda + ");\n");
+            }
+
+            w.write("    }\n");
+            w.write("\n");
+            w.write("    @Override\n");
+            w.write("    public Map<String, Supplier<Object>> getReadPropertyPlaceholderOptions(CamelContext camelContext) {\n");
+            w.write("        return readPlaceholders;\n");
+            w.write("    }\n");
+            w.write("\n");
+            w.write("    @Override\n");
+            w.write("    public Map<String, Consumer<Object>> getWritePropertyPlaceholderOptions(CamelContext camelContext) {\n");
+            w.write("        return writePlaceholders;\n");
+            w.write("    }\n");
+            w.write("\n");
+            w.write("}\n");
+            w.write("\n");
+        } catch (Exception e) {
+            processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, "Unable to generate source code file: " + fqn + ": " + e.getMessage());
+            dumpExceptionToErrorFile("camel-apt-error.log", "Unable to generate source code file: " + fqn, e);
+        } finally {
+            IOHelper.close(w);
+        }
+    }
+
+    private static String getterLambda(String getOrSet, String name, String type) {
+        String getPrefix = "boolean".equals(type) ? "is" : "get";
+        return "endpoint::" + getPrefix + getOrSet;
+    }
+
+    private static String setterLambda(String getOrSet, String name, String type) {
+        // type may contain generics so remove those
+        if (type.indexOf('<') != -1) {
+            type = type.substring(0, type.indexOf('<'));
+        }
+
+        //  writePlaceholders.put("groupSize", o -> endpoint.setGroupSize(camelContext.getTypeConverter().convertTo(Integer.class, o)));
+        StringBuilder sb = new StringBuilder();
+        sb.append("o -> endpoint.set").append(getOrSet).append("(camelContext.getTypeConverter().convertTo(").append(type).append(".class, o))");
+        return sb.toString();
+    }
+
+}


[camel] 10/12: CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit b1ac54017a0bfe03ab66e787bf24aeb9dd61a18b
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Aug 20 20:33:54 2019 +0200

    CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
---
 .../crypto/DigitalSignatureConfiguration.java      | 57 +++++++++++++++++-----
 .../component/crypto/DigitalSignatureEndpoint.java |  6 +--
 .../crypto/processor/SigningProcessor.java         |  2 +-
 .../DigitalSignatureEndpointBuilderFactory.java    | 14 +-----
 .../DigitalSignatureComponentConfiguration.java    |  6 +--
 5 files changed, 53 insertions(+), 32 deletions(-)

diff --git a/components/camel-crypto/src/main/java/org/apache/camel/component/crypto/DigitalSignatureConfiguration.java b/components/camel-crypto/src/main/java/org/apache/camel/component/crypto/DigitalSignatureConfiguration.java
index c81eb20..a0151dc 100644
--- a/components/camel-crypto/src/main/java/org/apache/camel/component/crypto/DigitalSignatureConfiguration.java
+++ b/components/camel-crypto/src/main/java/org/apache/camel/component/crypto/DigitalSignatureConfiguration.java
@@ -16,11 +16,16 @@
  */
 package org.apache.camel.component.crypto;
 
+import java.io.IOException;
+import java.security.GeneralSecurityException;
 import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
 import java.security.PrivateKey;
 import java.security.PublicKey;
 import java.security.SecureRandom;
 import java.security.Signature;
+import java.security.UnrecoverableKeyException;
 import java.security.cert.Certificate;
 
 import org.apache.camel.CamelContext;
@@ -59,8 +64,8 @@ public class DigitalSignatureConfiguration implements Cloneable, CamelContextAwa
     private String signatureHeaderName;
     @UriParam
     private String alias;
-    @UriParam(label = "security", javaType = "java.lang.String", secret = true)
-    private char[] password;
+    @UriParam(label = "security", secret = true)
+    private String password;
     @UriParam(label = "advanced")
     private PublicKey publicKey;
     @UriParam(label = "advanced")
@@ -151,8 +156,8 @@ public class DigitalSignatureConfiguration implements Cloneable, CamelContextAwa
     /**
      * Get the PrivateKey that should be used to sign the exchange
      */
-    public PrivateKey getPrivateKey() throws Exception {
-        return getPrivateKey(alias, password);
+    public PrivateKey getPrivateKey() {
+        return getPrivateKey(alias, password.toCharArray());
     }
 
     /**
@@ -162,7 +167,7 @@ public class DigitalSignatureConfiguration implements Cloneable, CamelContextAwa
      * @param alias the alias used to retrieve the Certificate from the keystore.
      */
     public PrivateKey getPrivateKey(String alias) throws Exception {
-        return getPrivateKey(alias, password);
+        return getPrivateKey(alias, password.toCharArray());
     }
 
     /**
@@ -171,10 +176,14 @@ public class DigitalSignatureConfiguration implements Cloneable, CamelContextAwa
      *
      * @param alias the alias used to retrieve the Certificate from the keystore.
      */
-    public PrivateKey getPrivateKey(String alias, char[] password) throws Exception {
+    public PrivateKey getPrivateKey(String alias, char[] password) {
         PrivateKey pk = null;
         if (alias != null && keystore != null) {
-            pk = (PrivateKey)keystore.getKey(alias, password);
+            try {
+                pk = (PrivateKey)keystore.getKey(alias, password);
+            } catch (Exception e) {
+                throw new RuntimeException(e);
+            }
         }
         if (pk == null) {
             pk = privateKey;
@@ -191,6 +200,10 @@ public class DigitalSignatureConfiguration implements Cloneable, CamelContextAwa
         this.privateKey = privateKey;
     }
 
+    public String getPrivateKeyName() {
+        return privateKeyName;
+    }
+
     /**
      * Sets the reference name for a PrivateKey that can be found in the registry.
      */
@@ -213,6 +226,10 @@ public class DigitalSignatureConfiguration implements Cloneable, CamelContextAwa
         this.publicKey = publicKey;
     }
 
+    public String getPublicKeyName() {
+        return publicKeyName;
+    }
+
     /**
      * Sets the reference name for a publicKey that can be found in the registry.
      */
@@ -259,7 +276,7 @@ public class DigitalSignatureConfiguration implements Cloneable, CamelContextAwa
      * Get the explicitly configured {@link Certificate} that should be used to
      * verify the signature in the exchange.
      */
-    public Certificate getCertificate() throws Exception {
+    public Certificate getCertificate() {
         return certificate;
     }
 
@@ -271,6 +288,10 @@ public class DigitalSignatureConfiguration implements Cloneable, CamelContextAwa
         this.certificate = certificate;
     }
 
+    public String getCertificateName() {
+        return certificateName;
+    }
+
     /**
      * Sets the reference name for a PrivateKey that can be found in the registry.
      */
@@ -310,6 +331,10 @@ public class DigitalSignatureConfiguration implements Cloneable, CamelContextAwa
         this.keystore = keystore;
     }
 
+    public String getKeystoreName() {
+        return keystoreName;
+    }
+
     /**
      * Sets the reference name for a Keystore that can be found in the registry.
      */
@@ -328,14 +353,14 @@ public class DigitalSignatureConfiguration implements Cloneable, CamelContextAwa
     /**
      * Gets the password used to access an aliased {@link PrivateKey} in the KeyStore.
      */
-    public char[] getPassword() {
+    public String getPassword() {
         return password;
     }
 
     /**
      * Sets the password used to access an aliased {@link PrivateKey} in the KeyStore.
      */
-    public void setPassword(char[] password) {
+    public void setPassword(String password) {
         this.password = password;
     }
 
@@ -352,10 +377,14 @@ public class DigitalSignatureConfiguration implements Cloneable, CamelContextAwa
      * supplied and there is only a single entry in the Keystore, then this
      * single entry will be used.
      */
-    public void setKeyStoreParameters(KeyStoreParameters keyStoreParameters) throws Exception {
+    public void setKeyStoreParameters(KeyStoreParameters keyStoreParameters) {
         this.keyStoreParameters = keyStoreParameters;
         if (keyStoreParameters != null) {
-            this.keystore = keyStoreParameters.createKeyStore();
+            try {
+                this.keystore = keyStoreParameters.createKeyStore();
+            } catch (Exception e) {
+                throw new RuntimeException(e);
+            }
         }
     }
 
@@ -366,6 +395,10 @@ public class DigitalSignatureConfiguration implements Cloneable, CamelContextAwa
         return secureRandom;
     }
 
+    public String getSecureRandomName() {
+        return secureRandomName;
+    }
+
     /**
      * Sets the reference name for a SecureRandom that can be found in the registry.
      */
diff --git a/components/camel-crypto/src/main/java/org/apache/camel/component/crypto/DigitalSignatureEndpoint.java b/components/camel-crypto/src/main/java/org/apache/camel/component/crypto/DigitalSignatureEndpoint.java
index 9d6c26f..f8269fe 100644
--- a/components/camel-crypto/src/main/java/org/apache/camel/component/crypto/DigitalSignatureEndpoint.java
+++ b/components/camel-crypto/src/main/java/org/apache/camel/component/crypto/DigitalSignatureEndpoint.java
@@ -58,7 +58,7 @@ public class DigitalSignatureEndpoint extends DefaultEndpoint {
         throw new UnsupportedOperationException("Digital Signatures endpoints are not meant to be consumed from. They are meant be used as an intermediate endpoints");
     }
 
-/**
+    /**
      * Sets the configuration to use
      */
     public void setConfiguration(DigitalSignatureConfiguration configuration) {
@@ -101,11 +101,11 @@ public class DigitalSignatureEndpoint extends DefaultEndpoint {
         getConfiguration().setKeystore(keystore);
     }
 
-    public char[] getPassword() {
+    public String getPassword() {
         return getConfiguration().getPassword();
     }
 
-    public void setKeyPassword(char[] keyPassword) {
+    public void setKeyPassword(String keyPassword) {
         getConfiguration().setPassword(keyPassword);
     }
 
diff --git a/components/camel-crypto/src/main/java/org/apache/camel/component/crypto/processor/SigningProcessor.java b/components/camel-crypto/src/main/java/org/apache/camel/component/crypto/processor/SigningProcessor.java
index 142ee3c..dbbc43e 100644
--- a/components/camel-crypto/src/main/java/org/apache/camel/component/crypto/processor/SigningProcessor.java
+++ b/components/camel-crypto/src/main/java/org/apache/camel/component/crypto/processor/SigningProcessor.java
@@ -80,7 +80,7 @@ public class SigningProcessor extends DigitalSignatureProcessor {
         if (keystore != null) {
             password = exchange.getIn().getHeader(DigitalSignatureConstants.KEYSTORE_PASSWORD, char[].class);
             if (password == null) {
-                password = config.getPassword();
+                password = config.getPassword() != null ? config.getPassword().toCharArray() : null;
             }
         }
         return password;
diff --git a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/DigitalSignatureEndpointBuilderFactory.java b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/DigitalSignatureEndpointBuilderFactory.java
index 7414fe8..9b1197a 100644
--- a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/DigitalSignatureEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/DigitalSignatureEndpointBuilderFactory.java
@@ -220,19 +220,7 @@ public interface DigitalSignatureEndpointBuilderFactory {
          * Sets the password used to access an aliased PrivateKey in the
          * KeyStore.
          * 
-         * The option is a: <code>char[]</code> type.
-         * 
-         * Group: security
-         */
-        default DigitalSignatureEndpointBuilder password(Character[] password) {
-            setProperty("password", password);
-            return this;
-        }
-        /**
-         * Sets the password used to access an aliased PrivateKey in the
-         * KeyStore.
-         * 
-         * The option will be converted to a <code>char[]</code> type.
+         * The option is a: <code>java.lang.String</code> type.
          * 
          * Group: security
          */
diff --git a/platforms/spring-boot/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/component/crypto/springboot/DigitalSignatureComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/component/crypto/springboot/DigitalSignatureComponentConfiguration.java
index 1dcccde..9c48f9c 100644
--- a/platforms/spring-boot/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/component/crypto/springboot/DigitalSignatureComponentConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/component/crypto/springboot/DigitalSignatureComponentConfiguration.java
@@ -137,7 +137,7 @@ public class DigitalSignatureComponentConfiguration
          * Sets the password used to access an aliased {@link PrivateKey} in the
          * KeyStore.
          */
-        private char[] password;
+        private String password;
         /**
          * Sets the KeyStore that can contain keys and Certficates for use in
          * signing and verifying exchanges based on the given
@@ -272,11 +272,11 @@ public class DigitalSignatureComponentConfiguration
             this.keystoreName = keystoreName;
         }
 
-        public char[] getPassword() {
+        public String getPassword() {
             return password;
         }
 
-        public void setPassword(char[] password) {
+        public void setPassword(String password) {
             this.password = password;
         }
 


[camel] 05/12: CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit fd3d33b6c864599e44086724b3d53dd96bec5fc0
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Aug 20 12:47:57 2019 +0200

    CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
---
 .../org/apache/camel/component/file/FileEndpoint.java  |  4 ++--
 .../camel/component/file/GenericFileEndpoint.java      |  8 ++++++++
 .../org/apache/camel/component/mock/MockEndpoint.java  | 18 +++++++++++++++++-
 .../apache/camel/component/timer/TimerEndpoint.java    | 16 ++++++++++------
 .../org/apache/camel/support/DefaultComponent.java     |  5 +++++
 .../apache/camel/support/PropertyBindingSupport.java   | 18 +++++++++++++++---
 .../camel/tools/apt/EndpointAnnotationProcessor.java   | 13 ++++++++-----
 .../tools/apt/EndpointPropertyConfigurerGenerator.java | 18 ++++--------------
 8 files changed, 69 insertions(+), 31 deletions(-)

diff --git a/components/camel-file/src/main/java/org/apache/camel/component/file/FileEndpoint.java b/components/camel-file/src/main/java/org/apache/camel/component/file/FileEndpoint.java
index e1a8ef2..29fe0a1 100644
--- a/components/camel-file/src/main/java/org/apache/camel/component/file/FileEndpoint.java
+++ b/components/camel-file/src/main/java/org/apache/camel/component/file/FileEndpoint.java
@@ -411,7 +411,7 @@ public class FileEndpoint extends GenericFileEndpoint<File> {
      * Specify the file permissions which is sent by the producer, the chmod value must be between 000 and 777;
      * If there is a leading digit like in 0755 we will ignore it.
      */
-    public void setChmod(String chmod) throws Exception {
+    public void setChmod(String chmod) {
         if (ObjectHelper.isNotEmpty(chmod) && chmodPermissionsAreValid(chmod)) {
             this.chmod = chmod.trim();
         } else {
@@ -472,7 +472,7 @@ public class FileEndpoint extends GenericFileEndpoint<File> {
      * Specify the directory permissions used when the producer creates missing directories, the chmod value must be between 000 and 777;
      * If there is a leading digit like in 0755 we will ignore it.
      */
-    public void setChmodDirectory(String chmodDirectory) throws Exception {
+    public void setChmodDirectory(String chmodDirectory) {
         if (ObjectHelper.isNotEmpty(chmodDirectory) && chmodPermissionsAreValid(chmodDirectory)) {
             this.chmodDirectory = chmodDirectory.trim();
         } else {
diff --git a/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java b/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
index 58aa43cf..09ef430 100644
--- a/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
+++ b/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
@@ -661,6 +661,10 @@ public abstract class GenericFileEndpoint<T> extends ScheduledPollEndpoint imple
         return idempotent != null;
     }
 
+    public Boolean getIdempotent() {
+        return idempotent;
+    }
+
     /**
      * Option to use the Idempotent Consumer EIP pattern to let Camel skip already processed files.
      * Will by default use a memory based LRUCache that holds 1000 entries. If noop=true then idempotent will be enabled
@@ -1003,6 +1007,10 @@ public abstract class GenericFileEndpoint<T> extends ScheduledPollEndpoint imple
         this.readLockRemoveOnCommit = readLockRemoveOnCommit;
     }
 
+    public int getReadLockIdempotentReleaseDelay() {
+        return readLockIdempotentReleaseDelay;
+    }
+
     /**
      * Whether to delay the release task for a period of millis.
      * <p/>
diff --git a/components/camel-mock/src/main/java/org/apache/camel/component/mock/MockEndpoint.java b/components/camel-mock/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
index 21dcad5..485b431 100644
--- a/components/camel-mock/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
+++ b/components/camel-mock/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
@@ -499,6 +499,10 @@ public class MockEndpoint extends DefaultEndpoint implements BrowsableEndpoint,
         setExpectedMessageCount(expectedCount);
     }
 
+    public long getAssertPeriod() {
+        return assertPeriod;
+    }
+
     /**
      * Sets a grace period after which the mock endpoint will re-assert
      * to ensure the preliminary assertion is still valid.
@@ -1293,6 +1297,10 @@ public class MockEndpoint extends DefaultEndpoint implements BrowsableEndpoint,
         this.resultWaitTime = resultWaitTime;
     }
 
+    public long getResultMinimumWaitTime() {
+        return resultMinimumWaitTime;
+    }
+
     /**
      * Sets the minimum expected amount of time (in millis) the {@link #assertIsSatisfied()} will
      * wait on a latch until it is satisfied
@@ -1363,6 +1371,10 @@ public class MockEndpoint extends DefaultEndpoint implements BrowsableEndpoint,
         this.reporter = reporter;
     }
 
+    public int getRetainFirst() {
+        return retainFirst;
+    }
+
     /**
      * Specifies to only retain the first n'th number of received {@link Exchange}s.
      * <p/>
@@ -1391,6 +1403,10 @@ public class MockEndpoint extends DefaultEndpoint implements BrowsableEndpoint,
         this.retainFirst = retainFirst;
     }
 
+    public int getRetainLast() {
+        return retainLast;
+    }
+
     /**
      * Specifies to only retain the last n'th number of received {@link Exchange}s.
      * <p/>
@@ -1419,7 +1435,7 @@ public class MockEndpoint extends DefaultEndpoint implements BrowsableEndpoint,
         this.retainLast = retainLast;
     }
 
-    public int isReportGroup() {
+    public int getReportGroup() {
         return reportGroup;
     }
 
diff --git a/components/camel-timer/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java b/components/camel-timer/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java
index 236dbb9..8cc57f8 100644
--- a/components/camel-timer/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java
+++ b/components/camel-timer/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java
@@ -225,12 +225,8 @@ public class TimerEndpoint extends DefaultEndpoint implements MultipleConsumersS
         this.pattern = pattern;
     }
 
-    public Timer getTimer(TimerConsumer consumer) {
-        if (timer != null) {
-            // use custom timer
-            return timer;
-        }
-        return getComponent().getTimer(consumer);
+    public Timer getTimer() {
+        return timer;
     }
 
     /**
@@ -240,6 +236,14 @@ public class TimerEndpoint extends DefaultEndpoint implements MultipleConsumersS
         this.timer = timer;
     }
 
+    public Timer getTimer(TimerConsumer consumer) {
+        if (timer != null) {
+            // use custom timer
+            return timer;
+        }
+        return getComponent().getTimer(consumer);
+    }
+
     public void removeTimer(TimerConsumer consumer) {
         if (timer == null) {
             // only remove timer if we are not using a custom timer
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java b/core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java
index 866f9a6..1b15a29 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java
@@ -43,6 +43,7 @@ import org.apache.camel.spi.PropertyConfigurer;
 import org.apache.camel.spi.PropertyConfigurerAware;
 import org.apache.camel.support.service.ServiceSupport;
 import org.apache.camel.util.ObjectHelper;
+import org.apache.camel.util.StringHelper;
 import org.apache.camel.util.URISupport;
 import org.apache.camel.util.UnsafeUriCharactersEncoder;
 import org.apache.camel.util.function.Suppliers;
@@ -333,6 +334,10 @@ public abstract class DefaultComponent extends ServiceSupport implements Compone
         org.apache.camel.spi.annotations.Component ann = ObjectHelper.getAnnotation(this, org.apache.camel.spi.annotations.Component.class);
         if (ann != null) {
             String name = ann.value();
+            // just grab first scheme name if the component has scheme alias (eg http,https)
+            if (name.contains(",")) {
+                name = StringHelper.before(name, ",");
+            }
             try {
                 Optional<Class<?>> clazz = getCamelContext().getExtension(ExtendedCamelContext.class).getFactoryFinder(RESOURCE_PATH)
                         .findOptionalClass(name + "-endpoint", null);
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java b/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
index 11ffbcc..4a43e24 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
@@ -33,6 +33,7 @@ import org.apache.camel.PropertyBindingException;
 import org.apache.camel.spi.PropertyConfigurer;
 import org.apache.camel.util.StringHelper;
 
+import static org.apache.camel.support.EndpointHelper.isReferenceParameter;
 import static org.apache.camel.support.IntrospectionSupport.findSetterMethods;
 import static org.apache.camel.util.ObjectHelper.isNotEmpty;
 
@@ -466,12 +467,23 @@ public final class PropertyBindingSupport {
                 Object value = entry.getValue();
                 if (writeProperties.containsKey(key)) {
 
-                    // TODO: reference
-                    // TODO: o
+                    // support reference parameters
+                    if (value instanceof String) {
+                        String text = (String) value;
+                        if (isReferenceParameter(text)) {
+                            if (text.startsWith("#bean:")) {
+                                text = text.substring(6);
+                            } else {
+                                text = text.substring(1);
+                            }
+                            value = CamelContextHelper.mandatoryLookup(camelContext, text);
+                        }
+                    }
+                    // TODO: that thing with boolean and from string value true|false
 
                     writeProperties.get(key).accept(value);
                     if (removeParameter) {
-                        properties.remove(key);
+                        iter.remove();
                         rc = true;
                     }
                 }
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
index 361bcef..ba3c1ff 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
@@ -116,14 +116,14 @@ public class EndpointAnnotationProcessor extends AbstractCamelAnnotationProcesso
                     String packageName = name.substring(0, name.lastIndexOf("."));
                     String fileName = alias + ".json";
                     processFile(processingEnv, packageName, fileName,
-                            writer -> writeJSonSchemeDocumentation(writer, roundEnv, classElement, uriEndpoint, aliasTitle, alias, extendsAlias, label, schemes));
+                            writer -> writeJSonSchemeAndPropertyConfigurer(writer, roundEnv, classElement, uriEndpoint, aliasTitle, alias, extendsAlias, label, schemes));
                 }
             }
         }
     }
 
-    protected void writeJSonSchemeDocumentation(PrintWriter writer, RoundEnvironment roundEnv, TypeElement classElement, UriEndpoint uriEndpoint,
-                                                String title, String scheme, String extendsScheme, String label, String[] schemes) {
+    protected void writeJSonSchemeAndPropertyConfigurer(PrintWriter writer, RoundEnvironment roundEnv, TypeElement classElement, UriEndpoint uriEndpoint,
+                                                        String title, String scheme, String extendsScheme, String label, String[] schemes) {
         // gather component information
         ComponentModel componentModel = findComponentProperties(roundEnv, uriEndpoint, classElement, title, scheme, extendsScheme, label);
 
@@ -180,8 +180,11 @@ public class EndpointAnnotationProcessor extends AbstractCamelAnnotationProcesso
         String cn = en + "Configurer";
         String fqn = pn + "." + cn;
 
-        EndpointPropertyConfigurerGenerator.generatePropertyConfigurer(processingEnv, parent, pn, cn, fqn, en, fqen, endpointPaths, endpointOptions);
-        EndpointPropertyConfigurerGenerator.generateMetaInfConfigurer(processingEnv, componentModel.getScheme() + "-endpoint", fqn);
+        // only generate this once for the first scheme
+        if (schemes == null || schemes[0].equals(scheme)) {
+            EndpointPropertyConfigurerGenerator.generatePropertyConfigurer(processingEnv, parent, pn, cn, fqn, en, fqen, endpointOptions);
+            EndpointPropertyConfigurerGenerator.generateMetaInfConfigurer(processingEnv, componentModel.getScheme() + "-endpoint", fqn);
+        }
     }
 
     public String createParameterJsonSchema(ComponentModel componentModel, Set<ComponentOption> componentOptions,
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointPropertyConfigurerGenerator.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointPropertyConfigurerGenerator.java
index 6e4e236..620e5c0 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointPropertyConfigurerGenerator.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointPropertyConfigurerGenerator.java
@@ -20,35 +20,34 @@ import java.io.IOException;
 import java.io.Writer;
 import java.util.Set;
 import javax.annotation.processing.ProcessingEnvironment;
-import javax.lang.model.element.AnnotationMirror;
 import javax.lang.model.element.TypeElement;
 import javax.tools.Diagnostic;
 import javax.tools.FileObject;
 import javax.tools.JavaFileObject;
 import javax.tools.StandardLocation;
 
-import org.apache.camel.spi.annotations.SubServiceFactory;
 import org.apache.camel.tools.apt.helper.IOHelper;
 import org.apache.camel.tools.apt.model.EndpointOption;
-import org.apache.camel.tools.apt.model.EndpointPath;
 
 import static org.apache.camel.tools.apt.AnnotationProcessorHelper.dumpExceptionToErrorFile;
 
 public final class EndpointPropertyConfigurerGenerator {
 
+    // TODO: We can omit the read properties as we only use the writes
+
     private EndpointPropertyConfigurerGenerator() {
     }
 
     public static void generatePropertyConfigurer(ProcessingEnvironment processingEnv, TypeElement parent,
                                                   String pn, String cn, String fqn, String en, String fqen,
-                                                  Set<EndpointPath> paths, Set<EndpointOption> options) {
+                                                  Set<EndpointOption> options) {
 
         Writer w = null;
         try {
             JavaFileObject src = processingEnv.getFiler().createSourceFile(fqn, parent);
             w = src.openWriter();
 
-            int size = paths.size() + options.size();
+            int size = options.size();
 
             w.write("/* Generated by org.apache.camel:apt */\n");
             w.write("package " + pn + ";\n");
@@ -76,15 +75,6 @@ public final class EndpointPropertyConfigurerGenerator {
             w.write("        " + en + " endpoint = (" + en + ") object;\n");
             w.write("\n");
 
-            // only include string types as they are the only ones we can use for property placeholders
-            for (EndpointPath option : paths) {
-                String getOrSet = option.getName();
-                getOrSet = Character.toUpperCase(getOrSet.charAt(0)) + getOrSet.substring(1);
-                String getterLambda = getterLambda(getOrSet, option.getName(), option.getType());
-                String setterLambda = setterLambda(getOrSet, option.getName(), option.getType());
-                w.write("        readPlaceholders.put(\"" + option.getName() + "\", " + getterLambda + ");\n");
-                w.write("        writePlaceholders.put(\"" + option.getName() + "\", " + setterLambda + ");\n");
-            }
             for (EndpointOption option : options) {
                 String getOrSet = option.getName();
                 getOrSet = Character.toUpperCase(getOrSet.charAt(0)) + getOrSet.substring(1);


[camel] 08/12: CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit adb0a34d93797b617a40c8b15aea8bedda45eba5
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Aug 20 20:08:47 2019 +0200

    CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
---
 .../camel-activemq/src/main/docs/activemq-component.adoc  |  2 +-
 components/camel-amqp/src/main/docs/amqp-component.adoc   |  2 +-
 .../component/atomix/client/map/AtomixMapConsumer.java    |  2 +-
 .../component/atomix/client/map/AtomixMapEndpoint.java    |  2 +-
 .../component/atomix/client/map/AtomixMapProducer.java    |  2 +-
 .../atomix/client/messaging/AtomixMessagingConsumer.java  |  2 +-
 .../atomix/client/messaging/AtomixMessagingEndpoint.java  |  2 +-
 .../atomix/client/messaging/AtomixMessagingProducer.java  |  2 +-
 .../atomix/client/multimap/AtomixMultiMapEndpoint.java    |  2 +-
 .../atomix/client/multimap/AtomixMultiMapProducer.java    |  2 +-
 .../atomix/client/queue/AtomixQueueConsumer.java          |  2 +-
 .../atomix/client/queue/AtomixQueueEndpoint.java          |  2 +-
 .../atomix/client/queue/AtomixQueueProducer.java          |  2 +-
 .../component/atomix/client/set/AtomixSetConsumer.java    |  2 +-
 .../component/atomix/client/set/AtomixSetEndpoint.java    |  2 +-
 .../component/atomix/client/set/AtomixSetProducer.java    |  2 +-
 .../atomix/client/value/AtomixValueConsumer.java          |  2 +-
 .../atomix/client/value/AtomixValueEndpoint.java          |  2 +-
 .../atomix/client/value/AtomixValueProducer.java          |  2 +-
 .../apache/camel/component/aws/sqs/SqsConfiguration.java  |  8 ++++++++
 components/camel-jms/src/main/docs/jms-component.adoc     |  2 +-
 .../org/apache/camel/component/jms/JmsConfiguration.java  |  6 +++++-
 .../aws/sqs/springboot/SqsComponentConfiguration.java     | 15 +++++++++------
 23 files changed, 42 insertions(+), 27 deletions(-)

diff --git a/components/camel-activemq/src/main/docs/activemq-component.adoc b/components/camel-activemq/src/main/docs/activemq-component.adoc
index 7b2e19a..16bd9ce 100644
--- a/components/camel-activemq/src/main/docs/activemq-component.adoc
+++ b/components/camel-activemq/src/main/docs/activemq-component.adoc
@@ -233,7 +233,7 @@ with the following path and query parameters:
 | *idleConsumerLimit* (advanced) | Specify the limit for the number of consumers that are allowed to be idle at any given time. | 1 | int
 | *idleTaskExecutionLimit* (advanced) | Specifies the limit for idle executions of a receive task, not having received any message within its execution. If this limit is reached, the task will shut down and leave receiving to other executing tasks (in the case of dynamic scheduling; see the maxConcurrentConsumers setting). There is additional doc available from Spring. | 1 | int
 | *includeAllJMSXProperties* (advanced) | Whether to include all JMSXxxx properties when mapping from JMS to Camel Message. Setting this to true will include properties such as JMSXAppID, and JMSXUserID etc. Note: If you are using a custom headerFilterStrategy then this option does not apply. | false | boolean
-| *jmsKeyFormatStrategy* (advanced) | Pluggable strategy for encoding and decoding JMS keys so they can be compliant with the JMS specification. Camel provides two implementations out of the box: default and passthrough. The default strategy will safely marshal dots and hyphens (. and -). The passthrough strategy leaves the key as is. Can be used for JMS brokers which do not care whether JMS header keys contain illegal characters. You can provide your own implementation of the org.apache [...]
+| *jmsKeyFormatStrategy* (advanced) | Pluggable strategy for encoding and decoding JMS keys so they can be compliant with the JMS specification. Camel provides two implementations out of the box: default and passthrough. The default strategy will safely marshal dots and hyphens (. and -). The passthrough strategy leaves the key as is. Can be used for JMS brokers which do not care whether JMS header keys contain illegal characters. You can provide your own implementation of the org.apache [...]
 | *mapJmsMessage* (advanced) | Specifies whether Camel should auto map the received JMS message to a suited payload type, such as javax.jms.TextMessage to a String etc. | true | boolean
 | *maxMessagesPerTask* (advanced) | The number of messages per task. -1 is unlimited. If you use a range for concurrent consumers (eg min max), then this option can be used to set a value to eg 100 to control how fast the consumers will shrink when less work is required. | -1 | int
 | *messageConverter* (advanced) | To use a custom Spring org.springframework.jms.support.converter.MessageConverter so you can be in control how to map to/from a javax.jms.Message. |  | MessageConverter
diff --git a/components/camel-amqp/src/main/docs/amqp-component.adoc b/components/camel-amqp/src/main/docs/amqp-component.adoc
index 5254845..0f8026c 100644
--- a/components/camel-amqp/src/main/docs/amqp-component.adoc
+++ b/components/camel-amqp/src/main/docs/amqp-component.adoc
@@ -223,7 +223,7 @@ with the following path and query parameters:
 | *idleConsumerLimit* (advanced) | Specify the limit for the number of consumers that are allowed to be idle at any given time. | 1 | int
 | *idleTaskExecutionLimit* (advanced) | Specifies the limit for idle executions of a receive task, not having received any message within its execution. If this limit is reached, the task will shut down and leave receiving to other executing tasks (in the case of dynamic scheduling; see the maxConcurrentConsumers setting). There is additional doc available from Spring. | 1 | int
 | *includeAllJMSXProperties* (advanced) | Whether to include all JMSXxxx properties when mapping from JMS to Camel Message. Setting this to true will include properties such as JMSXAppID, and JMSXUserID etc. Note: If you are using a custom headerFilterStrategy then this option does not apply. | false | boolean
-| *jmsKeyFormatStrategy* (advanced) | Pluggable strategy for encoding and decoding JMS keys so they can be compliant with the JMS specification. Camel provides two implementations out of the box: default and passthrough. The default strategy will safely marshal dots and hyphens (. and -). The passthrough strategy leaves the key as is. Can be used for JMS brokers which do not care whether JMS header keys contain illegal characters. You can provide your own implementation of the org.apache [...]
+| *jmsKeyFormatStrategy* (advanced) | Pluggable strategy for encoding and decoding JMS keys so they can be compliant with the JMS specification. Camel provides two implementations out of the box: default and passthrough. The default strategy will safely marshal dots and hyphens (. and -). The passthrough strategy leaves the key as is. Can be used for JMS brokers which do not care whether JMS header keys contain illegal characters. You can provide your own implementation of the org.apache [...]
 | *mapJmsMessage* (advanced) | Specifies whether Camel should auto map the received JMS message to a suited payload type, such as javax.jms.TextMessage to a String etc. | true | boolean
 | *maxMessagesPerTask* (advanced) | The number of messages per task. -1 is unlimited. If you use a range for concurrent consumers (eg min max), then this option can be used to set a value to eg 100 to control how fast the consumers will shrink when less work is required. | -1 | int
 | *messageConverter* (advanced) | To use a custom Spring org.springframework.jms.support.converter.MessageConverter so you can be in control how to map to/from a javax.jms.Message. |  | MessageConverter
diff --git a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/map/AtomixMapConsumer.java b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/map/AtomixMapConsumer.java
index 110cd5b..2627bd1 100644
--- a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/map/AtomixMapConsumer.java
+++ b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/map/AtomixMapConsumer.java
@@ -28,7 +28,7 @@ import org.apache.camel.component.atomix.client.AtomixClientConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-final class AtomixMapConsumer extends AbstractAtomixClientConsumer<AtomixMapEndpoint> {
+public final class AtomixMapConsumer extends AbstractAtomixClientConsumer<AtomixMapEndpoint> {
 
     private final List<Listener<DistributedMap.EntryEvent<Object, Object>>> listeners;
     private final String resourceName;
diff --git a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/map/AtomixMapEndpoint.java b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/map/AtomixMapEndpoint.java
index a11443f..99fab81 100644
--- a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/map/AtomixMapEndpoint.java
+++ b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/map/AtomixMapEndpoint.java
@@ -33,7 +33,7 @@ import org.apache.camel.spi.UriParam;
     title = "Atomix Map",
     syntax = "atomix-map:resourceName",
     label = "clustering")
-class AtomixMapEndpoint extends AbstractAtomixClientEndpoint<AtomixMapComponent, AtomixMapConfiguration> {
+public class AtomixMapEndpoint extends AbstractAtomixClientEndpoint<AtomixMapComponent, AtomixMapConfiguration> {
     @UriParam
     private AtomixMapConfiguration configuration;
 
diff --git a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/map/AtomixMapProducer.java b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/map/AtomixMapProducer.java
index fd7a73a..5515fb9 100644
--- a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/map/AtomixMapProducer.java
+++ b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/map/AtomixMapProducer.java
@@ -35,7 +35,7 @@ import static org.apache.camel.component.atomix.client.AtomixClientConstants.RES
 import static org.apache.camel.component.atomix.client.AtomixClientConstants.RESOURCE_TTL;
 import static org.apache.camel.component.atomix.client.AtomixClientConstants.RESOURCE_VALUE;
 
-final class AtomixMapProducer extends AbstractAtomixClientProducer<AtomixMapEndpoint, DistributedMap<Object, Object>> {
+public final class AtomixMapProducer extends AbstractAtomixClientProducer<AtomixMapEndpoint, DistributedMap<Object, Object>> {
     private final AtomixMapConfiguration configuration;
 
     protected AtomixMapProducer(AtomixMapEndpoint endpoint) {
diff --git a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/messaging/AtomixMessagingConsumer.java b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/messaging/AtomixMessagingConsumer.java
index f8763f5..3c101bb 100644
--- a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/messaging/AtomixMessagingConsumer.java
+++ b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/messaging/AtomixMessagingConsumer.java
@@ -36,7 +36,7 @@ import static org.apache.camel.component.atomix.client.AtomixClientConstants.CHA
 import static org.apache.camel.component.atomix.client.AtomixClientConstants.MEMBER_NAME;
 import static org.apache.camel.component.atomix.client.AtomixClientConstants.RESOURCE_NAME;
 
-final class AtomixMessagingConsumer extends AbstractAtomixClientConsumer<AtomixMessagingEndpoint> {
+public final class AtomixMessagingConsumer extends AbstractAtomixClientConsumer<AtomixMessagingEndpoint> {
 
     private final List<Listener<Message<Object>>> listeners;
     private final String resultHeader;
diff --git a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/messaging/AtomixMessagingEndpoint.java b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/messaging/AtomixMessagingEndpoint.java
index ed2eab2..d0674e9 100644
--- a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/messaging/AtomixMessagingEndpoint.java
+++ b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/messaging/AtomixMessagingEndpoint.java
@@ -33,7 +33,7 @@ import org.apache.camel.spi.UriParam;
     title = "Atomix Messaging",
     syntax = "atomix-messaging:resourceName",
     label = "clustering")
-final class AtomixMessagingEndpoint extends AbstractAtomixClientEndpoint<AtomixMessagingComponent, AtomixMessagingConfiguration> {
+public final class AtomixMessagingEndpoint extends AbstractAtomixClientEndpoint<AtomixMessagingComponent, AtomixMessagingConfiguration> {
     @UriParam
     private AtomixMessagingConfiguration configuration;
 
diff --git a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/messaging/AtomixMessagingProducer.java b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/messaging/AtomixMessagingProducer.java
index f5b371d..e04e5c0 100644
--- a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/messaging/AtomixMessagingProducer.java
+++ b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/messaging/AtomixMessagingProducer.java
@@ -35,7 +35,7 @@ import static org.apache.camel.component.atomix.client.messaging.AtomixMessaging
 import static org.apache.camel.component.atomix.client.messaging.AtomixMessaging.OPTIONS_BROADCAST_RANDOM;
 import static org.apache.camel.component.atomix.client.messaging.AtomixMessaging.OPTIONS_DIRECT;
 
-final class AtomixMessagingProducer extends AbstractAtomixClientProducer<AtomixMessagingEndpoint, DistributedGroup> {
+public final class AtomixMessagingProducer extends AbstractAtomixClientProducer<AtomixMessagingEndpoint, DistributedGroup> {
     private final AtomixMessagingConfiguration configuration;
 
     protected AtomixMessagingProducer(AtomixMessagingEndpoint endpoint) {
diff --git a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/multimap/AtomixMultiMapEndpoint.java b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/multimap/AtomixMultiMapEndpoint.java
index 113e9ed..0a0de4a 100644
--- a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/multimap/AtomixMultiMapEndpoint.java
+++ b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/multimap/AtomixMultiMapEndpoint.java
@@ -32,7 +32,7 @@ import org.apache.camel.spi.UriParam;
     syntax = "atomix-multimap:resourceName",
     consumerOnly = true,
     label = "clustering")
-final class AtomixMultiMapEndpoint extends AbstractAtomixClientEndpoint<AtomixMultiMapComponent, AtomixMultiMapConfiguration> {
+public final class AtomixMultiMapEndpoint extends AbstractAtomixClientEndpoint<AtomixMultiMapComponent, AtomixMultiMapConfiguration> {
     @UriParam
     private AtomixMultiMapConfiguration configuration;
 
diff --git a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/multimap/AtomixMultiMapProducer.java b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/multimap/AtomixMultiMapProducer.java
index 7c11d98..78df617 100644
--- a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/multimap/AtomixMultiMapProducer.java
+++ b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/multimap/AtomixMultiMapProducer.java
@@ -33,7 +33,7 @@ import static org.apache.camel.component.atomix.client.AtomixClientConstants.RES
 import static org.apache.camel.component.atomix.client.AtomixClientConstants.RESOURCE_TTL;
 import static org.apache.camel.component.atomix.client.AtomixClientConstants.RESOURCE_VALUE;
 
-final class AtomixMultiMapProducer extends AbstractAtomixClientProducer<AtomixMultiMapEndpoint, DistributedMultiMap> {
+public final class AtomixMultiMapProducer extends AbstractAtomixClientProducer<AtomixMultiMapEndpoint, DistributedMultiMap> {
     private final AtomixMultiMapConfiguration configuration;
 
     protected AtomixMultiMapProducer(AtomixMultiMapEndpoint endpoint) {
diff --git a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/queue/AtomixQueueConsumer.java b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/queue/AtomixQueueConsumer.java
index 00fb320..34afa61 100644
--- a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/queue/AtomixQueueConsumer.java
+++ b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/queue/AtomixQueueConsumer.java
@@ -28,7 +28,7 @@ import org.apache.camel.component.atomix.client.AtomixClientConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-final class AtomixQueueConsumer extends AbstractAtomixClientConsumer<AtomixQueueEndpoint> {
+public final class AtomixQueueConsumer extends AbstractAtomixClientConsumer<AtomixQueueEndpoint> {
 
     private final List<Listener<DistributedQueue.ValueEvent<Object>>> listeners;
     private final String resourceName;
diff --git a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/queue/AtomixQueueEndpoint.java b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/queue/AtomixQueueEndpoint.java
index a2bfa35..21fe107 100644
--- a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/queue/AtomixQueueEndpoint.java
+++ b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/queue/AtomixQueueEndpoint.java
@@ -33,7 +33,7 @@ import org.apache.camel.spi.UriParam;
     title = "Atomix Queue",
     syntax = "atomix-queue:resourceName",
     label = "clustering")
-final class AtomixQueueEndpoint extends AbstractAtomixClientEndpoint<AtomixQueueComponent, AtomixQueueConfiguration> {
+public final class AtomixQueueEndpoint extends AbstractAtomixClientEndpoint<AtomixQueueComponent, AtomixQueueConfiguration> {
     @UriParam
     private AtomixQueueConfiguration configuration;
 
diff --git a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/queue/AtomixQueueProducer.java b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/queue/AtomixQueueProducer.java
index d42cf9c..5446bea 100644
--- a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/queue/AtomixQueueProducer.java
+++ b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/queue/AtomixQueueProducer.java
@@ -29,7 +29,7 @@ import static org.apache.camel.component.atomix.client.AtomixClientConstants.RES
 import static org.apache.camel.component.atomix.client.AtomixClientConstants.RESOURCE_READ_CONSISTENCY;
 import static org.apache.camel.component.atomix.client.AtomixClientConstants.RESOURCE_VALUE;
 
-final class AtomixQueueProducer extends AbstractAtomixClientProducer<AtomixQueueEndpoint, DistributedQueue> {
+public final class AtomixQueueProducer extends AbstractAtomixClientProducer<AtomixQueueEndpoint, DistributedQueue> {
     private final AtomixQueueConfiguration configuration;
 
     protected AtomixQueueProducer(AtomixQueueEndpoint endpoint) {
diff --git a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/set/AtomixSetConsumer.java b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/set/AtomixSetConsumer.java
index 3f696d9..faef03a 100644
--- a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/set/AtomixSetConsumer.java
+++ b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/set/AtomixSetConsumer.java
@@ -28,7 +28,7 @@ import org.apache.camel.component.atomix.client.AtomixClientConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-final class AtomixSetConsumer extends AbstractAtomixClientConsumer<AtomixSetEndpoint> {
+public final class AtomixSetConsumer extends AbstractAtomixClientConsumer<AtomixSetEndpoint> {
 
     private final List<Listener<DistributedSet.ValueEvent<Object>>> listeners;
     private final String resourceName;
diff --git a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/set/AtomixSetEndpoint.java b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/set/AtomixSetEndpoint.java
index 88dad42..4a95a37 100644
--- a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/set/AtomixSetEndpoint.java
+++ b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/set/AtomixSetEndpoint.java
@@ -33,7 +33,7 @@ import org.apache.camel.spi.UriParam;
     title = "Atomix Set",
     syntax = "atomix-set:resourceName",
     label = "clustering")
-final class AtomixSetEndpoint extends AbstractAtomixClientEndpoint<AtomixSetComponent, AtomixSetConfiguration> {
+public final class AtomixSetEndpoint extends AbstractAtomixClientEndpoint<AtomixSetComponent, AtomixSetConfiguration> {
     @UriParam
     private AtomixSetConfiguration configuration;
 
diff --git a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/set/AtomixSetProducer.java b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/set/AtomixSetProducer.java
index 19aec85..7794383 100644
--- a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/set/AtomixSetProducer.java
+++ b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/set/AtomixSetProducer.java
@@ -32,7 +32,7 @@ import static org.apache.camel.component.atomix.client.AtomixClientConstants.RES
 import static org.apache.camel.component.atomix.client.AtomixClientConstants.RESOURCE_TTL;
 import static org.apache.camel.component.atomix.client.AtomixClientConstants.RESOURCE_VALUE;
 
-final class AtomixSetProducer extends AbstractAtomixClientProducer<AtomixSetEndpoint, DistributedSet> {
+public final class AtomixSetProducer extends AbstractAtomixClientProducer<AtomixSetEndpoint, DistributedSet> {
     private final AtomixSetConfiguration configuration;
 
     protected AtomixSetProducer(AtomixSetEndpoint endpoint) {
diff --git a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/value/AtomixValueConsumer.java b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/value/AtomixValueConsumer.java
index ac83bc1..520137b 100644
--- a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/value/AtomixValueConsumer.java
+++ b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/value/AtomixValueConsumer.java
@@ -28,7 +28,7 @@ import org.apache.camel.component.atomix.client.AtomixClientConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-final class AtomixValueConsumer extends AbstractAtomixClientConsumer<AtomixValueEndpoint> {
+public final class AtomixValueConsumer extends AbstractAtomixClientConsumer<AtomixValueEndpoint> {
 
     private final List<Listener<DistributedValue.ChangeEvent<Object>>> listeners;
     private final String resourceName;
diff --git a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/value/AtomixValueEndpoint.java b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/value/AtomixValueEndpoint.java
index 4e46520..804404f 100644
--- a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/value/AtomixValueEndpoint.java
+++ b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/value/AtomixValueEndpoint.java
@@ -33,7 +33,7 @@ import org.apache.camel.spi.UriParam;
     title = "Atomix Value",
     syntax = "atomix-value:resourceName",
     label = "clustering")
-final class AtomixValueEndpoint extends AbstractAtomixClientEndpoint<AtomixValueComponent, AtomixValueConfiguration> {
+public final class AtomixValueEndpoint extends AbstractAtomixClientEndpoint<AtomixValueComponent, AtomixValueConfiguration> {
     @UriParam
     private AtomixValueConfiguration configuration;
 
diff --git a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/value/AtomixValueProducer.java b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/value/AtomixValueProducer.java
index 1c83d24..a8ff5e1 100644
--- a/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/value/AtomixValueProducer.java
+++ b/components/camel-atomix/src/main/java/org/apache/camel/component/atomix/client/value/AtomixValueProducer.java
@@ -33,7 +33,7 @@ import static org.apache.camel.component.atomix.client.AtomixClientConstants.RES
 import static org.apache.camel.component.atomix.client.AtomixClientConstants.RESOURCE_TTL;
 import static org.apache.camel.component.atomix.client.AtomixClientConstants.RESOURCE_VALUE;
 
-final class AtomixValueProducer extends AbstractAtomixClientProducer<AtomixValueEndpoint, DistributedValue> {
+public final class AtomixValueProducer extends AbstractAtomixClientProducer<AtomixValueEndpoint, DistributedValue> {
     private final AtomixValueConfiguration configuration;
 
     protected AtomixValueProducer(AtomixValueEndpoint endpoint) {
diff --git a/components/camel-aws-sqs/src/main/java/org/apache/camel/component/aws/sqs/SqsConfiguration.java b/components/camel-aws-sqs/src/main/java/org/apache/camel/component/aws/sqs/SqsConfiguration.java
index e449e16..81f9944 100644
--- a/components/camel-aws-sqs/src/main/java/org/apache/camel/component/aws/sqs/SqsConfiguration.java
+++ b/components/camel-aws-sqs/src/main/java/org/apache/camel/component/aws/sqs/SqsConfiguration.java
@@ -476,6 +476,10 @@ public class SqsConfiguration implements Cloneable {
         }
     }
 
+    public void setMessageGroupIdStrategy(MessageGroupIdStrategy messageGroupIdStrategy) {
+        this.messageGroupIdStrategy = messageGroupIdStrategy;
+    }
+
     public MessageGroupIdStrategy getMessageGroupIdStrategy() {
         return messageGroupIdStrategy;
     }
@@ -500,6 +504,10 @@ public class SqsConfiguration implements Cloneable {
         }
     }
 
+    public void setMessageDeduplicationIdStrategy(MessageDeduplicationIdStrategy messageDeduplicationIdStrategy) {
+        this.messageDeduplicationIdStrategy = messageDeduplicationIdStrategy;
+    }
+
     public SqsOperations getOperation() {
         return operation;
     }
diff --git a/components/camel-jms/src/main/docs/jms-component.adoc b/components/camel-jms/src/main/docs/jms-component.adoc
index 68efe6d..0a42500 100644
--- a/components/camel-jms/src/main/docs/jms-component.adoc
+++ b/components/camel-jms/src/main/docs/jms-component.adoc
@@ -390,7 +390,7 @@ with the following path and query parameters:
 | *idleConsumerLimit* (advanced) | Specify the limit for the number of consumers that are allowed to be idle at any given time. | 1 | int
 | *idleTaskExecutionLimit* (advanced) | Specifies the limit for idle executions of a receive task, not having received any message within its execution. If this limit is reached, the task will shut down and leave receiving to other executing tasks (in the case of dynamic scheduling; see the maxConcurrentConsumers setting). There is additional doc available from Spring. | 1 | int
 | *includeAllJMSXProperties* (advanced) | Whether to include all JMSXxxx properties when mapping from JMS to Camel Message. Setting this to true will include properties such as JMSXAppID, and JMSXUserID etc. Note: If you are using a custom headerFilterStrategy then this option does not apply. | false | boolean
-| *jmsKeyFormatStrategy* (advanced) | Pluggable strategy for encoding and decoding JMS keys so they can be compliant with the JMS specification. Camel provides two implementations out of the box: default and passthrough. The default strategy will safely marshal dots and hyphens (. and -). The passthrough strategy leaves the key as is. Can be used for JMS brokers which do not care whether JMS header keys contain illegal characters. You can provide your own implementation of the org.apache [...]
+| *jmsKeyFormatStrategy* (advanced) | Pluggable strategy for encoding and decoding JMS keys so they can be compliant with the JMS specification. Camel provides two implementations out of the box: default and passthrough. The default strategy will safely marshal dots and hyphens (. and -). The passthrough strategy leaves the key as is. Can be used for JMS brokers which do not care whether JMS header keys contain illegal characters. You can provide your own implementation of the org.apache [...]
 | *mapJmsMessage* (advanced) | Specifies whether Camel should auto map the received JMS message to a suited payload type, such as javax.jms.TextMessage to a String etc. | true | boolean
 | *maxMessagesPerTask* (advanced) | The number of messages per task. -1 is unlimited. If you use a range for concurrent consumers (eg min max), then this option can be used to set a value to eg 100 to control how fast the consumers will shrink when less work is required. | -1 | int
 | *messageConverter* (advanced) | To use a custom Spring org.springframework.jms.support.converter.MessageConverter so you can be in control how to map to/from a javax.jms.Message. |  | MessageConverter
diff --git a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
index 7109b35..2759338 100644
--- a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
+++ b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
@@ -309,7 +309,7 @@ public class JmsConfiguration implements Cloneable {
                     + " Possible values are: Bytes, Map, Object, Stream, Text."
                     + " By default, Camel would determine which JMS message type to use from the In body type. This option allows you to specify it.")
     private JmsMessageType jmsMessageType;
-    @UriParam(label = "advanced", enums = "default,passthrough", javaType = "java.lang.String",
+    @UriParam(label = "advanced", enums = "default,passthrough",
             description = "Pluggable strategy for encoding and decoding JMS keys so they can be compliant with the JMS specification."
                     + " Camel provides two implementations out of the box: default and passthrough."
                     + " The default strategy will safely marshal dots and hyphens (. and -). The passthrough strategy leaves the key as is."
@@ -1213,6 +1213,10 @@ public class JmsConfiguration implements Cloneable {
         return explicitQosEnabled != null ? explicitQosEnabled : false;
     }
 
+    public Boolean getExplicitQosEnabled() {
+        return explicitQosEnabled;
+    }
+
     /**
      * Set if the deliveryMode, priority or timeToLive qualities of service should be used when sending messages.
      * This option is based on Spring's JmsTemplate. The deliveryMode, priority and timeToLive options are applied to the current endpoint.
diff --git a/platforms/spring-boot/components-starter/camel-aws-sqs-starter/src/main/java/org/apache/camel/component/aws/sqs/springboot/SqsComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-aws-sqs-starter/src/main/java/org/apache/camel/component/aws/sqs/springboot/SqsComponentConfiguration.java
index 4de9aa7..49af144 100644
--- a/platforms/spring-boot/components-starter/camel-aws-sqs-starter/src/main/java/org/apache/camel/component/aws/sqs/springboot/SqsComponentConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-aws-sqs-starter/src/main/java/org/apache/camel/component/aws/sqs/springboot/SqsComponentConfiguration.java
@@ -18,6 +18,8 @@ package org.apache.camel.component.aws.sqs.springboot;
 
 import javax.annotation.Generated;
 import com.amazonaws.services.sqs.AmazonSQS;
+import org.apache.camel.component.aws.sqs.MessageDeduplicationIdStrategy;
+import org.apache.camel.component.aws.sqs.MessageGroupIdStrategy;
 import org.apache.camel.component.aws.sqs.SqsOperations;
 import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon;
 import org.springframework.boot.context.properties.ConfigurationProperties;
@@ -261,7 +263,7 @@ public class SqsComponentConfiguration
          * *useExchangeId*, *usePropertyValue*. For the *usePropertyValue*
          * option, the value of property "CamelAwsMessageGroupId" will be used.
          */
-        private String messageGroupIdStrategy;
+        private MessageGroupIdStrategy messageGroupIdStrategy;
         /**
          * Only for FIFO queues. Strategy for setting the messageDeduplicationId
          * on the message. Can be one of the following options: *useExchangeId*,
@@ -269,7 +271,7 @@ public class SqsComponentConfiguration
          * *useContentBasedDeduplication* option, no messageDeduplicationId will
          * be set on the message.
          */
-        private String messageDeduplicationIdStrategy = "useExchangeId";
+        private MessageDeduplicationIdStrategy messageDeduplicationIdStrategy;
         /**
          * The operation to do in case the user don't want to send only a
          * message
@@ -515,20 +517,21 @@ public class SqsComponentConfiguration
             this.serverSideEncryptionEnabled = serverSideEncryptionEnabled;
         }
 
-        public String getMessageGroupIdStrategy() {
+        public MessageGroupIdStrategy getMessageGroupIdStrategy() {
             return messageGroupIdStrategy;
         }
 
-        public void setMessageGroupIdStrategy(String messageGroupIdStrategy) {
+        public void setMessageGroupIdStrategy(
+                MessageGroupIdStrategy messageGroupIdStrategy) {
             this.messageGroupIdStrategy = messageGroupIdStrategy;
         }
 
-        public String getMessageDeduplicationIdStrategy() {
+        public MessageDeduplicationIdStrategy getMessageDeduplicationIdStrategy() {
             return messageDeduplicationIdStrategy;
         }
 
         public void setMessageDeduplicationIdStrategy(
-                String messageDeduplicationIdStrategy) {
+                MessageDeduplicationIdStrategy messageDeduplicationIdStrategy) {
             this.messageDeduplicationIdStrategy = messageDeduplicationIdStrategy;
         }
 


[camel] 07/12: CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 31cf888d5449a4cef0dbe1d31c9e6b3d8f4946ac
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Aug 20 19:14:57 2019 +0200

    CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
---
 .../apache/camel/component/as2/AS2Endpoint.java    |  4 ---
 .../camel/component/atmos/AtmosEndpoint.java       |  1 +
 .../apache/camel/support/IntrospectionSupport.java |  2 +-
 .../camel/support/PropertyBindingSupport.java      |  3 +-
 .../EndpointPropertyConfigurerSupport.java         | 10 +++++++
 .../apt/CoreEipAnnotationProcessorHelper.java      |  2 +-
 .../tools/apt/EndpointAnnotationProcessor.java     | 35 ++++++++--------------
 .../apt/EndpointPropertyConfigurerGenerator.java   | 21 +++++++++----
 .../tools/apt/SpringAnnotationProcessorHelper.java |  2 +-
 .../camel/tools/apt/helper/JsonSchemaHelper.java   | 13 ++++++--
 .../camel/tools/apt/model/EndpointOption.java      | 14 ++++++++-
 .../tools/apt/EndpointOptionComparatorTest.java    |  8 ++---
 12 files changed, 70 insertions(+), 45 deletions(-)

diff --git a/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Endpoint.java b/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Endpoint.java
index 5a9a8a7..40b39d3 100644
--- a/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Endpoint.java
+++ b/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Endpoint.java
@@ -67,10 +67,6 @@ public class AS2Endpoint extends AbstractApiEndpoint<AS2ApiName, AS2Configuratio
         this.configuration = endpointConfiguration;
     }
 
-    public AS2Configuration getAs2Configuration() {
-        return configuration;
-    }
-
     public AS2ClientConnection getAS2ClientConnection() {
         return as2ClientConnection;
     }
diff --git a/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/AtmosEndpoint.java b/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/AtmosEndpoint.java
index c0b7a32..c5b12c1 100644
--- a/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/AtmosEndpoint.java
+++ b/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/AtmosEndpoint.java
@@ -27,6 +27,7 @@ import org.apache.camel.component.atmos.integration.producer.AtmosMoveProducer;
 import org.apache.camel.component.atmos.integration.producer.AtmosPutProducer;
 import org.apache.camel.component.atmos.util.AtmosException;
 import org.apache.camel.component.atmos.util.AtmosOperation;
+import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.support.DefaultEndpoint;
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/IntrospectionSupport.java b/core/camel-support/src/main/java/org/apache/camel/support/IntrospectionSupport.java
index e742c0e..fe0dd72 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/IntrospectionSupport.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/IntrospectionSupport.java
@@ -714,7 +714,7 @@ public final class IntrospectionSupport {
                     } else {
                         // We need to convert it
                         // special for boolean values with string values as we only want to accept "true" or "false"
-                        if (parameterType == Boolean.class || parameterType == boolean.class && ref instanceof String) {
+                        if ((parameterType == Boolean.class || parameterType == boolean.class) && ref instanceof String) {
                             String val = (String) ref;
                             if (!val.equalsIgnoreCase("true") && !val.equalsIgnoreCase("false")) {
                                 throw new IllegalArgumentException("Cannot convert the String value: " + ref + " to type: " + parameterType
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java b/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
index a7a8c79..9e328f4 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
@@ -458,7 +458,7 @@ public final class PropertyBindingSupport {
         org.apache.camel.util.ObjectHelper.notNull(properties, "properties");
         boolean rc = false;
 
-        // TODO: quick and dirty to only use configurer
+        // if there is a property configurer then use it to set the properties
         if (configurer != null) {
             Map<String, Consumer<Object>> writeProperties = configurer.getWritePropertyPlaceholderOptions(camelContext);
             for (Iterator<Map.Entry<String, Object>> iter = properties.entrySet().iterator(); iter.hasNext();) {
@@ -466,7 +466,6 @@ public final class PropertyBindingSupport {
                 String key = entry.getKey();
                 Object value = entry.getValue();
                 if (writeProperties.containsKey(key)) {
-                    // TODO: that thing with boolean and from string value true|false (should be in EndpointPropertyConfigurerSupport)
                     writeProperties.get(key).accept(value);
                     if (removeParameter) {
                         iter.remove();
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/component/EndpointPropertyConfigurerSupport.java b/core/camel-support/src/main/java/org/apache/camel/support/component/EndpointPropertyConfigurerSupport.java
index e9e9f6e..55a47e1 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/component/EndpointPropertyConfigurerSupport.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/component/EndpointPropertyConfigurerSupport.java
@@ -35,6 +35,16 @@ public abstract class EndpointPropertyConfigurerSupport implements EndpointPrope
                 }
             }
         }
+
+        // special for boolean values with string values as we only want to accept "true" or "false"
+        if ((type == Boolean.class || type == boolean.class) && value instanceof String) {
+            String text = (String) value;
+            if (!text.equalsIgnoreCase("true") && !text.equalsIgnoreCase("false")) {
+                throw new IllegalArgumentException("Cannot convert the String value: " + value + " to type: " + type
+                        + " as the value is not true or false");
+            }
+        }
+
         return camelContext.getTypeConverter().convertTo(type, value);
     }
 
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/CoreEipAnnotationProcessorHelper.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/CoreEipAnnotationProcessorHelper.java
index f003530..06b2d79 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/CoreEipAnnotationProcessorHelper.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/CoreEipAnnotationProcessorHelper.java
@@ -245,7 +245,7 @@ public class CoreEipAnnotationProcessorHelper {
             doc = sanitizeDescription(doc, false);
             buffer.append(JsonSchemaHelper.toJson(entry.getName(), entry.getDisplayName(), entry.getKind(), entry.isRequired(), entry.getType(), entry.getDefaultValue(), doc,
                                                   entry.isDeprecated(), entry.getDeprecationNote(), false, null, null, entry.isEnumType(), entry.getEnums(), entry.isOneOf(),
-                                                  entry.getOneOfTypes(), entry.isAsPredicate(), null, null, false));
+                                                  entry.getOneOfTypes(), entry.isAsPredicate(), null, null, false, null, null));
         }
         buffer.append("\n  }");
 
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
index 0e9bccb..fc6f99b 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
@@ -168,7 +168,7 @@ public class EndpointAnnotationProcessor extends AbstractCamelAnnotationProcesso
             findComponentClassProperties(writer, roundEnv, componentModel, componentOptions, componentClassElement, "", parentData);
         }
 
-        findClassProperties(writer, roundEnv, componentModel, endpointPaths, endpointOptions, classElement, "", uriEndpoint.excludeProperties(), parentData);
+        findClassProperties(writer, roundEnv, componentModel, endpointPaths, endpointOptions, classElement, "", uriEndpoint.excludeProperties(), parentData, null, null);
 
         String json = createParameterJsonSchema(componentModel, componentOptions, endpointPaths, endpointOptions, schemes, parentData);
         writer.println(json);
@@ -268,7 +268,7 @@ public class EndpointAnnotationProcessor extends AbstractCamelAnnotationProcesso
 
             buffer.append(JsonSchemaHelper.toJson(entry.getName(), entry.getDisplayName(), "property", required, entry.getType(), defaultValue, doc,
                 entry.isDeprecated(), entry.getDeprecationNote(), entry.isSecret(), entry.getGroup(), entry.getLabel(), entry.isEnumType(), entry.getEnums(),
-                false, null, asPredicate, optionalPrefix, prefix, multiValue));
+                false, null, asPredicate, optionalPrefix, prefix, multiValue, null, null));
 
             parentComponentProperties.remove(entry.getName());
         }
@@ -342,7 +342,7 @@ public class EndpointAnnotationProcessor extends AbstractCamelAnnotationProcesso
 
             buffer.append(JsonSchemaHelper.toJson(entry.getName(), entry.getDisplayName(), "path", required, entry.getType(), defaultValue, doc,
                 entry.isDeprecated(), entry.getDeprecationNote(), entry.isSecret(), entry.getGroup(), entry.getLabel(), entry.isEnumType(), entry.getEnums(),
-                false, null, asPredicate, optionalPrefix, prefix, multiValue));
+                false, null, asPredicate, optionalPrefix, prefix, multiValue, null, null));
 
             parentProperties.remove(entry.getName());
         }
@@ -390,7 +390,7 @@ public class EndpointAnnotationProcessor extends AbstractCamelAnnotationProcesso
 
             buffer.append(JsonSchemaHelper.toJson(entry.getName(), entry.getDisplayName(), "parameter", required, entry.getType(), defaultValue,
                 doc, entry.isDeprecated(), entry.getDeprecationNote(), entry.isSecret(), entry.getGroup(), entry.getLabel(), entry.isEnumType(), entry.getEnums(),
-                false, null, asPredicate, optionalPrefix, prefix, multiValue));
+                false, null, asPredicate, optionalPrefix, prefix, multiValue, entry.getNestedTypeName(), entry.getNestedFieldName()));
 
             parentProperties.remove(entry.getName());
         }
@@ -629,7 +629,7 @@ public class EndpointAnnotationProcessor extends AbstractCamelAnnotationProcesso
     protected void findClassProperties(PrintWriter writer, RoundEnvironment roundEnv, ComponentModel componentModel,
                                        Set<EndpointPath> endpointPaths, Set<EndpointOption> endpointOptions,
                                        TypeElement classElement, String prefix, String excludeProperties,
-                                       Map<String, Object> parentData) {
+                                       Map<String, Object> parentData, String nestedTypeName, String nestedFieldName) {
         Elements elementUtils = processingEnv.getElementUtils();
         while (true) {
             List<VariableElement> fieldElements = ElementFilter.fieldsIn(classElement.getEnclosedElements());
@@ -765,7 +765,11 @@ public class EndpointAnnotationProcessor extends AbstractCamelAnnotationProcesso
                         if (!isNullOrEmpty(extraPrefix)) {
                             nestedPrefix += extraPrefix;
                         }
-                        findClassProperties(writer, roundEnv, componentModel, endpointPaths, endpointOptions, fieldTypeElement, nestedPrefix, excludeProperties, null);
+                        nestedTypeName = fieldTypeName;
+                        nestedFieldName = fieldElement.getSimpleName().toString();
+                        findClassProperties(writer, roundEnv, componentModel, endpointPaths, endpointOptions, fieldTypeElement, nestedPrefix, excludeProperties, null, nestedTypeName, nestedFieldName);
+                        nestedTypeName = null;
+                        nestedFieldName = null;
                     } else {
                         String docComment = findJavaDoc(elementUtils, fieldElement, fieldName, name, classElement, false);
                         if (isNullOrEmpty(docComment)) {
@@ -810,7 +814,8 @@ public class EndpointAnnotationProcessor extends AbstractCamelAnnotationProcesso
                         boolean isSecret = secret != null && secret || param.secret();
                         String group = EndpointHelper.labelAsGroupName(label, componentModel.isConsumerOnly(), componentModel.isProducerOnly());
                         EndpointOption option = new EndpointOption(name, displayName, fieldTypeName, required, defaultValue, defaultValueNote,
-                                docComment.trim(), paramOptionalPrefix, paramPrefix, multiValue, deprecated, deprecationNote, isSecret, group, label, isEnum, enums);
+                                docComment.trim(), paramOptionalPrefix, paramPrefix, multiValue, deprecated, deprecationNote, isSecret, group, label,
+                                isEnum, enums, nestedTypeName, nestedFieldName);
                         endpointOptions.add(option);
                     }
                 }
@@ -843,22 +848,6 @@ public class EndpointAnnotationProcessor extends AbstractCamelAnnotationProcesso
         return false;
     }
 
-    private static Map<String, String> parseAsMap(String data) {
-        Map<String, String> answer = new HashMap<>();
-        String[] lines = data.split("\n");
-        for (String line : lines) {
-            if (!line.isEmpty()) {
-                int idx = line.indexOf('=');
-                String key = line.substring(0, idx);
-                String value = line.substring(idx + 1);
-                // remove ending line break for the values
-                value = value.trim().replaceAll("\n", "");
-                answer.put(key.trim(), value);
-            }
-        }
-        return answer;
-    }
-
     private static boolean secureAlias(String scheme, String alias) {
         if (scheme.equals(alias)) {
             return false;
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointPropertyConfigurerGenerator.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointPropertyConfigurerGenerator.java
index 0d969d5..c46c178 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointPropertyConfigurerGenerator.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointPropertyConfigurerGenerator.java
@@ -78,8 +78,8 @@ public final class EndpointPropertyConfigurerGenerator {
             for (EndpointOption option : options) {
                 String getOrSet = option.getName();
                 getOrSet = Character.toUpperCase(getOrSet.charAt(0)) + getOrSet.substring(1);
-                String getterLambda = getterLambda(getOrSet, option.getName(), option.getType());
-                String setterLambda = setterLambda(getOrSet, option.getName(), option.getType());
+                String getterLambda = getterLambda(getOrSet, option.getName(), option.getType(), option.getNestedFieldName());
+                String setterLambda = setterLambda(getOrSet, option.getName(), option.getType(), option.getNestedFieldName());
                 w.write("        readPlaceholders.put(\"" + option.getName() + "\", " + getterLambda + ");\n");
                 w.write("        writePlaceholders.put(\"" + option.getName() + "\", " + setterLambda + ");\n");
             }
@@ -106,19 +106,28 @@ public final class EndpointPropertyConfigurerGenerator {
         }
     }
 
-    private static String getterLambda(String getOrSet, String name, String type) {
+    private static String getterLambda(String getOrSet, String name, String type, String nestedFieldName) {
+        String nested = "";
+        if (nestedFieldName != null) {
+            nested = "get" + Character.toUpperCase(nestedFieldName.charAt(0)) + nestedFieldName.substring(1) + "().";
+        }
         String getPrefix = "boolean".equals(type) ? "is" : "get";
-        return "endpoint::" + getPrefix + getOrSet;
+        return "() -> endpoint." + nested + "" + getPrefix + getOrSet + "()";
     }
 
-    private static String setterLambda(String getOrSet, String name, String type) {
+    private static String setterLambda(String getOrSet, String name, String type, String nestedFieldName) {
         // type may contain generics so remove those
         if (type.indexOf('<') != -1) {
             type = type.substring(0, type.indexOf('<'));
         }
+        if (nestedFieldName != null) {
+            getOrSet = "get" + Character.toUpperCase(nestedFieldName.charAt(0)) + nestedFieldName.substring(1) + "().set" + getOrSet;
+        } else {
+            getOrSet = "set" + getOrSet;
+        }
 
         StringBuilder sb = new StringBuilder();
-        sb.append("o -> endpoint.set").append(getOrSet).append("(property(camelContext, ").append(type).append(".class, o))");
+        sb.append("o -> endpoint.").append(getOrSet).append("(property(camelContext, ").append(type).append(".class, o))");
         return sb.toString();
     }
 
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/SpringAnnotationProcessorHelper.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/SpringAnnotationProcessorHelper.java
index 3706c68..fff0004 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/SpringAnnotationProcessorHelper.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/SpringAnnotationProcessorHelper.java
@@ -139,7 +139,7 @@ public class SpringAnnotationProcessorHelper {
 
             buffer.append(JsonSchemaHelper.toJson(entry.getName(), entry.getDisplayName(), entry.getKind(), entry.isRequired(), entry.getType(), entry.getDefaultValue(), doc,
                                                   entry.isDeprecated(), entry.getDeprecationNote(), false, null, null, entry.isEnumType(), entry.getEnums(), entry.isOneOf(),
-                                                  entry.getOneOfTypes(), entry.isAsPredicate(), null, null, false));
+                                                  entry.getOneOfTypes(), entry.isAsPredicate(), null, null, false, null, null));
         }
         buffer.append("\n  }");
 
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/helper/JsonSchemaHelper.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/helper/JsonSchemaHelper.java
index f2c7ef2..3f6822b 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/helper/JsonSchemaHelper.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/helper/JsonSchemaHelper.java
@@ -42,7 +42,8 @@ public final class JsonSchemaHelper {
 
     public static String toJson(String name, String displayName, String kind, Boolean required, String type, String defaultValue, String description,
                                 Boolean deprecated, String deprecationNote, Boolean secret, String group, String label, boolean enumType, Set<String> enums,
-                                boolean oneOfType, Set<String> oneOffTypes, boolean asPredicate, String optionalPrefix, String prefix, boolean multiValue) {
+                                boolean oneOfType, Set<String> oneOffTypes, boolean asPredicate, String optionalPrefix, String prefix, boolean multiValue,
+                                String nestedTypeName, String nestedFieldName) {
         String typeName = JsonSchemaHelper.getType(type, enumType);
 
         StringBuilder sb = new StringBuilder();
@@ -153,6 +154,15 @@ public final class JsonSchemaHelper {
             }
         }
 
+        if (!Strings.isNullOrEmpty(nestedTypeName)) {
+            sb.append(", \"nestedTypeName\": ");
+            sb.append(Strings.doubleQuote(nestedTypeName));
+        }
+        if (!Strings.isNullOrEmpty(nestedFieldName)) {
+            sb.append(", \"nestedFieldName\": ");
+            sb.append(Strings.doubleQuote(nestedFieldName));
+        }
+
         if (!Strings.isNullOrEmpty(description)) {
             sb.append(", \"description\": ");
             String text = sanitizeDescription(description, false);
@@ -202,7 +212,6 @@ public final class JsonSchemaHelper {
      * @return  the json schema primitive type, or <tt>null</tt> if not a primitive
      */
     public static String getPrimitiveType(String name) {
-
         // special for byte[] or Object[] as its common to use
         if ("java.lang.byte[]".equals(name) || "byte[]".equals(name)) {
             return "string";
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/model/EndpointOption.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/model/EndpointOption.java
index 3bffc22..c8e6113 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/model/EndpointOption.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/model/EndpointOption.java
@@ -39,11 +39,13 @@ public final class EndpointOption {
     private String label;
     private boolean enumType;
     private Set<String> enums;
+    private String nestedTypeName;
+    private String nestedFieldName;
 
     public EndpointOption(String name, String displayName, String type, boolean required, String defaultValue, String defaultValueNote,
                           String documentation, String optionalPrefix, String prefix, boolean multiValue,
                           boolean deprecated, String deprecationNote, boolean secret, String group, String label,
-                          boolean enumType, Set<String> enums) {
+                          boolean enumType, Set<String> enums, String nestedTypeName, String nestedFieldName) {
         this.name = name;
         this.displayName = displayName;
         this.type = type;
@@ -61,6 +63,8 @@ public final class EndpointOption {
         this.label = label;
         this.enumType = enumType;
         this.enums = enums;
+        this.nestedTypeName = nestedTypeName;
+        this.nestedFieldName = nestedFieldName;
     }
 
     public String getName() {
@@ -133,6 +137,14 @@ public final class EndpointOption {
         return enums;
     }
 
+    public String getNestedTypeName() {
+        return nestedTypeName;
+    }
+
+    public String getNestedFieldName() {
+        return nestedFieldName;
+    }
+
     public String getGroup() {
         return group;
     }
diff --git a/tooling/apt/src/test/java/org/apache/camel/tools/apt/EndpointOptionComparatorTest.java b/tooling/apt/src/test/java/org/apache/camel/tools/apt/EndpointOptionComparatorTest.java
index 13f43aa..adcf03b 100644
--- a/tooling/apt/src/test/java/org/apache/camel/tools/apt/EndpointOptionComparatorTest.java
+++ b/tooling/apt/src/test/java/org/apache/camel/tools/apt/EndpointOptionComparatorTest.java
@@ -40,13 +40,13 @@ public class EndpointOptionComparatorTest {
         String group4 = EndpointHelper.labelAsGroupName(label4, false, false);
 
         EndpointOption op1 = new EndpointOption("first", "First", "string", true, "", "", "blah", null, null, false,
-            false, null, false, group1, label1, false, null);
+            false, null, false, group1, label1, false, null, null, null);
         EndpointOption op2 = new EndpointOption("synchronous", "Synchronous", "string", true, "", "", "blah", null, null, false,
-            false, null, false, group2, label2, false, null);
+            false, null, false, group2, label2, false, null, null, null);
         EndpointOption op3 = new EndpointOption("second", "Second", "string", true, "", "", "blah", null, null, false,
-            false, null, false, group3, label3, false, null);
+            false, null, false, group3, label3, false, null, null, null);
         EndpointOption op4 = new EndpointOption("country", "Country", "string", true, "", "", "blah", null, null, false,
-            false, null, false, group4, label4, false, null);
+            false, null, false, group4, label4, false, null, null, null);
 
         List<EndpointOption> list = new ArrayList<>();
         list.add(op1);


[camel] 12/12: CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 8ca15bc40b4e6fbab1a1f0f2271a50899eb1fc15
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Aug 20 21:03:43 2019 +0200

    CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
---
 .../camel/component/elasticsearch/ElasticsearchComponent.java  |  2 +-
 .../component/elasticsearch/ElasticsearchConfiguration.java    | 10 +++++-----
 .../camel/component/elasticsearch/ElasticsearchEndpoint.java   |  4 ++++
 .../camel/component/elasticsearch/ElasticsearchProducer.java   |  8 ++++----
 .../facebook/config/FacebookEndpointConfiguration.java         |  4 ++--
 5 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchComponent.java b/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchComponent.java
index f1c7f17f..1975c90 100644
--- a/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchComponent.java
+++ b/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchComponent.java
@@ -106,7 +106,7 @@ public class ElasticsearchComponent extends DefaultComponent {
                 throw new IllegalArgumentException();
             }
             Integer port = split.length > 1 ? Integer.parseInt(split[1]) : ElasticsearchConstants.DEFAULT_PORT;
-            addressesTrAd.add(new HttpHost(hostname, port, config.getEnableSSL() ? "HTTPS" : "HTTP"));
+            addressesTrAd.add(new HttpHost(hostname, port, config.isEnableSSL() ? "HTTPS" : "HTTP"));
         }
         return addressesTrAd;
     }
diff --git a/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java b/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java
index 23525d9..263e4bf 100644
--- a/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java
+++ b/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java
@@ -170,11 +170,11 @@ public class ElasticsearchConfiguration {
     /**
      * Enable SSL
      */
-    public Boolean getEnableSSL() {
+    public boolean isEnableSSL() {
         return enableSSL;
     }
 
-    public void setEnableSSL(Boolean enableSSL) {
+    public void setEnableSSL(boolean enableSSL) {
         this.enableSSL = enableSSL;
     }
 
@@ -192,11 +192,11 @@ public class ElasticsearchConfiguration {
     /**
      * Disconnect after it finish calling the producer
      */
-    public Boolean getDisconnect() {
+    public boolean isDisconnect() {
         return disconnect;
     }
 
-    public void setDisconnect(Boolean disconnect) {
+    public void setDisconnect(boolean disconnect) {
         this.disconnect = disconnect;
     }
 
@@ -237,7 +237,7 @@ public class ElasticsearchConfiguration {
     /**
      * Enable scroll usage
      */
-    public boolean getUseScroll() {
+    public boolean isUseScroll() {
         return useScroll;
     }
 
diff --git a/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java b/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java
index 5ff147d..41f7728 100644
--- a/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java
+++ b/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java
@@ -42,6 +42,10 @@ public class ElasticsearchEndpoint extends DefaultEndpoint {
         this.client = client;
     }
 
+    public ElasticsearchConfiguration getConfiguration() {
+        return configuration;
+    }
+
     @Override
     public Producer createProducer() throws Exception {
         return new ElasticsearchProducer(this, configuration);
diff --git a/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchProducer.java b/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchProducer.java
index 1ba7d30..ab92790 100644
--- a/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchProducer.java
+++ b/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchProducer.java
@@ -114,7 +114,7 @@ public class ElasticsearchProducer extends DefaultProducer {
 
     @Override
     public void process(Exchange exchange) throws Exception {
-        if (configuration.getDisconnect() && client == null) {
+        if (configuration.isDisconnect() && client == null) {
             startClient();
         }
         RestHighLevelClient restHighLevelClient = new HighLevelClient(client);
@@ -189,7 +189,7 @@ public class ElasticsearchProducer extends DefaultProducer {
         } else if (operation == ElasticsearchOperation.Search) {
             SearchRequest searchRequest = message.getBody(SearchRequest.class);
             // is it a scroll request ?
-            boolean useScroll = message.getHeader(PARAM_SCROLL, configuration.getUseScroll(), Boolean.class);
+            boolean useScroll = message.getHeader(PARAM_SCROLL, configuration.isUseScroll(), Boolean.class);
             if (useScroll) {
                 int scrollKeepAliveMs = message.getHeader(PARAM_SCROLL_KEEP_ALIVE_MS, configuration.getScrollKeepAliveMs(), Integer.class);
                 ElasticsearchScrollRequestIterator scrollRequestIterator = new ElasticsearchScrollRequestIterator(searchRequest, restHighLevelClient, scrollKeepAliveMs, exchange);
@@ -222,7 +222,7 @@ public class ElasticsearchProducer extends DefaultProducer {
         if (configWaitForActiveShards) {
             message.removeHeader(ElasticsearchConstants.PARAM_WAIT_FOR_ACTIVE_SHARDS);
         }
-        if (configuration.getDisconnect()) {
+        if (configuration.isDisconnect()) {
             IOHelper.close(client);
             IOHelper.close(restHighLevelClient);
             client = null;
@@ -238,7 +238,7 @@ public class ElasticsearchProducer extends DefaultProducer {
     @SuppressWarnings("unchecked")
     protected void doStart() throws Exception {
         super.doStart();
-        if (!configuration.getDisconnect()) {
+        if (!configuration.isDisconnect()) {
             startClient();
         }
     }
diff --git a/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/config/FacebookEndpointConfiguration.java b/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/config/FacebookEndpointConfiguration.java
index 7ff01d4..3273c85 100644
--- a/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/config/FacebookEndpointConfiguration.java
+++ b/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/config/FacebookEndpointConfiguration.java
@@ -425,7 +425,7 @@ public class FacebookEndpointConfiguration extends FacebookConfiguration {
         this.ids = ids;
     }
 
-    public Boolean isIncludeRead() {
+    public Boolean getIncludeRead() {
         return includeRead;
     }
 
@@ -920,7 +920,7 @@ public class FacebookEndpointConfiguration extends FacebookConfiguration {
         this.tabId = tabId;
     }
 
-    public Boolean isHidden() {
+    public Boolean getIsHidden() {
         return isHidden;
     }
 


[camel] 09/12: CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit e15a5b8a413f2b384b053f77ab1c6f6aab0d0ea6
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Aug 20 20:23:54 2019 +0200

    CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
---
 .../src/main/docs/caffeine-cache-component.adoc    |  4 +-
 .../main/docs/caffeine-loadcache-component.adoc    |  4 +-
 .../component/caffeine/CaffeineConfiguration.java  | 16 ++--
 .../caffeine/cache/CaffeineCacheProducer.java      | 24 ++++--
 .../caffeine/load/CaffeineLoadCacheProducer.java   | 24 ++++--
 .../src/main/docs/cql-component.adoc               |  2 +-
 .../component/cassandra/CassandraEndpoint.java     |  2 +-
 .../src/main/docs/chatscript-component.adoc        |  4 +-
 .../component/chatscript/ChatScriptEndpoint.java   | 21 +++--
 .../dsl/CaffeineCacheEndpointBuilderFactory.java   | 96 ++--------------------
 .../CaffeineLoadCacheEndpointBuilderFactory.java   | 96 ++--------------------
 .../dsl/ChatScriptEndpointBuilderFactory.java      | 30 +++----
 .../CaffeineCacheComponentConfiguration.java       | 12 +--
 .../CaffeineLoadCacheComponentConfiguration.java   | 12 +--
 14 files changed, 101 insertions(+), 246 deletions(-)

diff --git a/components/camel-caffeine/src/main/docs/caffeine-cache-component.adoc b/components/camel-caffeine/src/main/docs/caffeine-cache-component.adoc
index 6cceaa2..0031981 100644
--- a/components/camel-caffeine/src/main/docs/caffeine-cache-component.adoc
+++ b/components/camel-caffeine/src/main/docs/caffeine-cache-component.adoc
@@ -90,9 +90,9 @@ with the following path and query parameters:
 | *statsCounter* (producer) | Set a specific Stats Counter for the cache stats |  | StatsCounter
 | *statsEnabled* (producer) | To enable stats on the cache | false | boolean
 | *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
-| *keyType* (advanced) | The cache key type, default java.lang.Object | java.lang.Object | String
+| *keyType* (advanced) | The cache key type, default java.lang.Object |  | String
 | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean
-| *valueType* (advanced) | The cache value type, default java.lang.Object | java.lang.Object | String
+| *valueType* (advanced) | The cache value type, default java.lang.Object |  | String
 |===
 // endpoint options: END
 // spring-boot-auto-configure options: START
diff --git a/components/camel-caffeine/src/main/docs/caffeine-loadcache-component.adoc b/components/camel-caffeine/src/main/docs/caffeine-loadcache-component.adoc
index aea2ee3..8990f6c 100644
--- a/components/camel-caffeine/src/main/docs/caffeine-loadcache-component.adoc
+++ b/components/camel-caffeine/src/main/docs/caffeine-loadcache-component.adoc
@@ -90,9 +90,9 @@ with the following path and query parameters:
 | *statsCounter* (producer) | Set a specific Stats Counter for the cache stats |  | StatsCounter
 | *statsEnabled* (producer) | To enable stats on the cache | false | boolean
 | *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
-| *keyType* (advanced) | The cache key type, default java.lang.Object | java.lang.Object | String
+| *keyType* (advanced) | The cache key type, default java.lang.Object |  | String
 | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean
-| *valueType* (advanced) | The cache value type, default java.lang.Object | java.lang.Object | String
+| *valueType* (advanced) | The cache value type, default java.lang.Object |  | String
 |===
 // endpoint options: END
 // spring-boot-auto-configure options: START
diff --git a/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/CaffeineConfiguration.java b/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/CaffeineConfiguration.java
index e7db733..0e7c5fe 100644
--- a/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/CaffeineConfiguration.java
+++ b/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/CaffeineConfiguration.java
@@ -32,10 +32,10 @@ public class CaffeineConfiguration implements Cloneable {
     private String action;
     @UriParam(label = "producer")
     private Object key;
-    @UriParam(label = "advanced", javaType = "java.lang.String", defaultValue = "java.lang.Object")
-    private Class<?> keyType = Object.class;
-    @UriParam(label = "advanced", javaType = "java.lang.String", defaultValue = "java.lang.Object")
-    private Class<?> valueType = Object.class;
+    @UriParam(label = "advanced")
+    private String keyType;
+    @UriParam(label = "advanced")
+    private String valueType;
     @UriParam(label = "producer")
     private Cache cache;
     @UriParam(label = "producer")
@@ -96,25 +96,25 @@ public class CaffeineConfiguration implements Cloneable {
         this.key = key;
     }
 
-    public Class<?> getKeyType() {
+    public String getKeyType() {
         return keyType;
     }
 
     /**
      * The cache key type, default "java.lang.Object"
      */
-    public void setKeyType(Class<?> keyType) {
+    public void setKeyType(String keyType) {
         this.keyType = keyType;
     }
 
-    public Class<?> getValueType() {
+    public String getValueType() {
         return valueType;
     }
 
     /**
      * The cache value type, default "java.lang.Object"
      */
-    public void setValueType(Class<?> valueType) {
+    public void setValueType(String valueType) {
         this.valueType = valueType;
     }
 
diff --git a/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/cache/CaffeineCacheProducer.java b/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/cache/CaffeineCacheProducer.java
index 618a1e0..133896b 100644
--- a/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/cache/CaffeineCacheProducer.java
+++ b/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/cache/CaffeineCacheProducer.java
@@ -33,8 +33,7 @@ public class CaffeineCacheProducer extends HeaderSelectorProducer {
     private final Cache cache;
 
     public CaffeineCacheProducer(CaffeineCacheEndpoint endpoint, String cacheName, CaffeineConfiguration configuration, Cache cache) throws Exception {
-        super(endpoint, CaffeineConstants.ACTION, () -> configuration.getAction());
-
+        super(endpoint, CaffeineConstants.ACTION, configuration::getAction);
         this.configuration = configuration;
         this.cache = cache;
     }
@@ -59,7 +58,7 @@ public class CaffeineCacheProducer extends HeaderSelectorProducer {
 
     @InvokeOnHeader(CaffeineConstants.ACTION_PUT_ALL)
     public void onPutAll(Message message) throws Exception {
-        cache.putAll((Map)getValue(message, Map.class));
+        cache.putAll((Map)getValue(message, Map.class.getName()));
 
         setResult(message, true, null, null);
     }
@@ -97,7 +96,13 @@ public class CaffeineCacheProducer extends HeaderSelectorProducer {
     // ****************************
 
     private Object getKey(final Message message) throws Exception {
-        Object value = message.getHeader(CaffeineConstants.KEY, configuration.getKeyType());
+        Object value;
+        if (configuration.getKeyType() != null) {
+            Class<?> clazz = getEndpoint().getCamelContext().getClassResolver().resolveClass(configuration.getKeyType());
+            value = message.getHeader(CaffeineConstants.KEY, clazz);
+        } else {
+            value = message.getHeader(CaffeineConstants.KEY);
+        }
         if (value == null) {
             value = configuration.getKey();
         }
@@ -109,10 +114,15 @@ public class CaffeineCacheProducer extends HeaderSelectorProducer {
         return value;
     }
 
-    private Object getValue(final Message message, final Class<?> type) throws Exception {
-        Object value = message.getHeader(CaffeineConstants.VALUE, type);
+    private Object getValue(final Message message, final String type) throws Exception {
+        Object value = message.getHeader(CaffeineConstants.VALUE);
         if (value == null) {
-            value = message.getBody(type);
+            if (type != null) {
+                Class<?> clazz = getEndpoint().getCamelContext().getClassResolver().resolveClass(type);
+                value = message.getBody(clazz);
+            } else {
+                value = message.getBody();
+            }
         }
 
         if (value == null) {
diff --git a/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/load/CaffeineLoadCacheProducer.java b/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/load/CaffeineLoadCacheProducer.java
index 56e2ab1..0aff158 100644
--- a/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/load/CaffeineLoadCacheProducer.java
+++ b/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/load/CaffeineLoadCacheProducer.java
@@ -33,8 +33,7 @@ public class CaffeineLoadCacheProducer extends HeaderSelectorProducer {
     private final LoadingCache cache;
 
     public CaffeineLoadCacheProducer(CaffeineLoadCacheEndpoint endpoint, String cacheName, CaffeineConfiguration configuration, LoadingCache cache) throws Exception {
-        super(endpoint, CaffeineConstants.ACTION, () -> configuration.getAction());
-
+        super(endpoint, CaffeineConstants.ACTION, configuration::getAction);
         this.configuration = configuration;
         this.cache = cache;
     }
@@ -59,7 +58,7 @@ public class CaffeineLoadCacheProducer extends HeaderSelectorProducer {
 
     @InvokeOnHeader(CaffeineConstants.ACTION_PUT_ALL)
     public void onPutAll(Message message) throws Exception {
-        cache.putAll((Map)getValue(message, Map.class));
+        cache.putAll((Map)getValue(message, Map.class.getName()));
 
         setResult(message, true, null, null);
     }
@@ -97,7 +96,13 @@ public class CaffeineLoadCacheProducer extends HeaderSelectorProducer {
     // ****************************
 
     private Object getKey(final Message message) throws Exception {
-        Object value = message.getHeader(CaffeineConstants.KEY, configuration.getKeyType());
+        Object value;
+        if (configuration.getKeyType() != null) {
+            Class<?> clazz = getEndpoint().getCamelContext().getClassResolver().resolveClass(configuration.getKeyType());
+            value = message.getHeader(CaffeineConstants.KEY, clazz);
+        } else {
+            value = message.getHeader(CaffeineConstants.KEY);
+        }
         if (value == null) {
             value = configuration.getKey();
         }
@@ -109,10 +114,15 @@ public class CaffeineLoadCacheProducer extends HeaderSelectorProducer {
         return value;
     }
 
-    private Object getValue(final Message message, final Class<?> type) throws Exception {
-        Object value = message.getHeader(CaffeineConstants.VALUE, type);
+    private Object getValue(final Message message, final String type) throws Exception {
+        Object value = message.getHeader(CaffeineConstants.VALUE);
         if (value == null) {
-            value = message.getBody(type);
+            if (type != null) {
+                Class<?> clazz = getEndpoint().getCamelContext().getClassResolver().resolveClass(type);
+                value = message.getBody(clazz);
+            } else {
+                value = message.getBody();
+            }
         }
 
         if (value == null) {
diff --git a/components/camel-cassandraql/src/main/docs/cql-component.adoc b/components/camel-cassandraql/src/main/docs/cql-component.adoc
index cb3dfaf..33157c1 100644
--- a/components/camel-cassandraql/src/main/docs/cql-component.adoc
+++ b/components/camel-cassandraql/src/main/docs/cql-component.adoc
@@ -103,7 +103,7 @@ with the following path and query parameters:
 | *loadBalancingPolicy* (common) | To use a specific LoadBalancingPolicy |  | String
 | *password* (common) | Password for session authentication |  | String
 | *prepareStatements* (common) | Whether to use PreparedStatements or regular Statements | true | boolean
-| *resultSetConversionStrategy* (common) | To use a custom class that implements logic for converting ResultSet into message body ALL, ONE, LIMIT_10, LIMIT_100... |  | String
+| *resultSetConversionStrategy* (common) | To use a custom class that implements logic for converting ResultSet into message body ALL, ONE, LIMIT_10, LIMIT_100... |  | ResultSetConversion Strategy
 | *session* (common) | To use the Session instance (you would normally not use this option) |  | Session
 | *username* (common) | Username for session authentication |  | String
 | *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
diff --git a/components/camel-cassandraql/src/main/java/org/apache/camel/component/cassandra/CassandraEndpoint.java b/components/camel-cassandraql/src/main/java/org/apache/camel/component/cassandra/CassandraEndpoint.java
index e045e9f..d715fde 100644
--- a/components/camel-cassandraql/src/main/java/org/apache/camel/component/cassandra/CassandraEndpoint.java
+++ b/components/camel-cassandraql/src/main/java/org/apache/camel/component/cassandra/CassandraEndpoint.java
@@ -70,7 +70,7 @@ public class CassandraEndpoint extends ScheduledPollEndpoint {
     private ConsistencyLevel consistencyLevel;
     @UriParam
     private String loadBalancingPolicy;
-    @UriParam(javaType = "java.lang.String")
+    @UriParam
     private ResultSetConversionStrategy resultSetConversionStrategy = ResultSetConversionStrategies.all();
 
     public CassandraEndpoint(String endpointUri, Component component) {
diff --git a/components/camel-chatscript/src/main/docs/chatscript-component.adoc b/components/camel-chatscript/src/main/docs/chatscript-component.adoc
index 47b4538..f99e2c0 100644
--- a/components/camel-chatscript/src/main/docs/chatscript-component.adoc
+++ b/components/camel-chatscript/src/main/docs/chatscript-component.adoc
@@ -76,11 +76,11 @@ with the following path and query parameters:
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
+| *chatUserName* (producer) | Username who initializes the CS conversation. To be set when chat is initialized from camel route |  | String
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
+| *resetChat* (producer) | Issues :reset command to start a new conversation everytime | false | boolean
 | *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
 | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean
-| *resetchat* (reset) | Issues :reset command to start a new conversation everytime | false | boolean
-| *chatUserName* (username) | Username who initializes the CS conversation. To be set when chat is initialized from camel route |  | String
 |===
 // endpoint options: END
 
diff --git a/components/camel-chatscript/src/main/java/org/apache/camel/component/chatscript/ChatScriptEndpoint.java b/components/camel-chatscript/src/main/java/org/apache/camel/component/chatscript/ChatScriptEndpoint.java
index 15823fa..0db76ad 100644
--- a/components/camel-chatscript/src/main/java/org/apache/camel/component/chatscript/ChatScriptEndpoint.java
+++ b/components/camel-chatscript/src/main/java/org/apache/camel/component/chatscript/ChatScriptEndpoint.java
@@ -37,8 +37,11 @@ import static org.apache.camel.component.chatscript.utils.ChatScriptConstants.DE
  * Represents a ChatScript endpoint.
  */
 @UriEndpoint(firstVersion = "3.0.0", scheme = "chatscript", title = "ChatScript", syntax = "chatscript:host:port/botName",  producerOnly = true, label = "ai,chatscript")
-public class ChatScriptEndpoint extends DefaultEndpoint { 
-    @UriPath (description = "Hostname or IP of the server on which CS server is running") 
+public class ChatScriptEndpoint extends DefaultEndpoint {
+
+    private ChatScriptBot bot;
+
+    @UriPath (description = "Hostname or IP of the server on which CS server is running")
     @Metadata(required = true)
     private String host;
     @UriPath(description = "Port on which ChatScript is listening to", defaultValue = "" + DEFAULT_PORT)
@@ -46,11 +49,11 @@ public class ChatScriptEndpoint extends DefaultEndpoint {
     @UriPath(description = "Name of the Bot in CS to converse with")
     @Metadata(required = true)
     private String botName;
-    @UriParam(description = "Username who initializes the CS conversation. To be set when chat is initialized from camel route", label = "username")
+    @UriParam(description = "Username who initializes the CS conversation. To be set when chat is initialized from camel route")
     private String chatUserName;
-    @UriParam (description = "Issues :reset command to start a new conversation everytime", label = "reset", defaultValue = "false")
-    private boolean resetchat;
-    private ChatScriptBot bot;
+    @UriParam (description = "Issues :reset command to start a new conversation everytime", defaultValue = "false")
+    private boolean resetChat;
+
     public ChatScriptEndpoint() {
     }
 
@@ -76,11 +79,11 @@ public class ChatScriptEndpoint extends DefaultEndpoint {
 
     }
     public boolean isResetChat() {
-        return resetchat;
+        return resetChat;
     }
 
-    public void setResetchat(boolean resetChat) {
-        this.resetchat = resetChat;
+    public void setResetChat(boolean resetChat) {
+        this.resetChat = resetChat;
     }
 
     public String getChatUserName() {
diff --git a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/CaffeineCacheEndpointBuilderFactory.java b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/CaffeineCacheEndpointBuilderFactory.java
index 258807a..401cccc 100644
--- a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/CaffeineCacheEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/CaffeineCacheEndpointBuilderFactory.java
@@ -200,21 +200,7 @@ public interface CaffeineCacheEndpointBuilderFactory {
         /**
          * The cache key type, default java.lang.Object.
          * 
-         * The option is a: <code>java.lang.Class&lt;java.lang.Object&gt;</code>
-         * type.
-         * 
-         * Group: advanced
-         */
-        default AdvancedCaffeineCacheEndpointConsumerBuilder keyType(
-                Class<Object> keyType) {
-            setProperty("keyType", keyType);
-            return this;
-        }
-        /**
-         * The cache key type, default java.lang.Object.
-         * 
-         * The option will be converted to a
-         * <code>java.lang.Class&lt;java.lang.Object&gt;</code> type.
+         * The option is a: <code>java.lang.String</code> type.
          * 
          * Group: advanced
          */
@@ -252,21 +238,7 @@ public interface CaffeineCacheEndpointBuilderFactory {
         /**
          * The cache value type, default java.lang.Object.
          * 
-         * The option is a: <code>java.lang.Class&lt;java.lang.Object&gt;</code>
-         * type.
-         * 
-         * Group: advanced
-         */
-        default AdvancedCaffeineCacheEndpointConsumerBuilder valueType(
-                Class<Object> valueType) {
-            setProperty("valueType", valueType);
-            return this;
-        }
-        /**
-         * The cache value type, default java.lang.Object.
-         * 
-         * The option will be converted to a
-         * <code>java.lang.Class&lt;java.lang.Object&gt;</code> type.
+         * The option is a: <code>java.lang.String</code> type.
          * 
          * Group: advanced
          */
@@ -681,21 +653,7 @@ public interface CaffeineCacheEndpointBuilderFactory {
         /**
          * The cache key type, default java.lang.Object.
          * 
-         * The option is a: <code>java.lang.Class&lt;java.lang.Object&gt;</code>
-         * type.
-         * 
-         * Group: advanced
-         */
-        default AdvancedCaffeineCacheEndpointProducerBuilder keyType(
-                Class<Object> keyType) {
-            setProperty("keyType", keyType);
-            return this;
-        }
-        /**
-         * The cache key type, default java.lang.Object.
-         * 
-         * The option will be converted to a
-         * <code>java.lang.Class&lt;java.lang.Object&gt;</code> type.
+         * The option is a: <code>java.lang.String</code> type.
          * 
          * Group: advanced
          */
@@ -733,21 +691,7 @@ public interface CaffeineCacheEndpointBuilderFactory {
         /**
          * The cache value type, default java.lang.Object.
          * 
-         * The option is a: <code>java.lang.Class&lt;java.lang.Object&gt;</code>
-         * type.
-         * 
-         * Group: advanced
-         */
-        default AdvancedCaffeineCacheEndpointProducerBuilder valueType(
-                Class<Object> valueType) {
-            setProperty("valueType", valueType);
-            return this;
-        }
-        /**
-         * The cache value type, default java.lang.Object.
-         * 
-         * The option will be converted to a
-         * <code>java.lang.Class&lt;java.lang.Object&gt;</code> type.
+         * The option is a: <code>java.lang.String</code> type.
          * 
          * Group: advanced
          */
@@ -833,21 +777,7 @@ public interface CaffeineCacheEndpointBuilderFactory {
         /**
          * The cache key type, default java.lang.Object.
          * 
-         * The option is a: <code>java.lang.Class&lt;java.lang.Object&gt;</code>
-         * type.
-         * 
-         * Group: advanced
-         */
-        default AdvancedCaffeineCacheEndpointBuilder keyType(
-                Class<Object> keyType) {
-            setProperty("keyType", keyType);
-            return this;
-        }
-        /**
-         * The cache key type, default java.lang.Object.
-         * 
-         * The option will be converted to a
-         * <code>java.lang.Class&lt;java.lang.Object&gt;</code> type.
+         * The option is a: <code>java.lang.String</code> type.
          * 
          * Group: advanced
          */
@@ -884,21 +814,7 @@ public interface CaffeineCacheEndpointBuilderFactory {
         /**
          * The cache value type, default java.lang.Object.
          * 
-         * The option is a: <code>java.lang.Class&lt;java.lang.Object&gt;</code>
-         * type.
-         * 
-         * Group: advanced
-         */
-        default AdvancedCaffeineCacheEndpointBuilder valueType(
-                Class<Object> valueType) {
-            setProperty("valueType", valueType);
-            return this;
-        }
-        /**
-         * The cache value type, default java.lang.Object.
-         * 
-         * The option will be converted to a
-         * <code>java.lang.Class&lt;java.lang.Object&gt;</code> type.
+         * The option is a: <code>java.lang.String</code> type.
          * 
          * Group: advanced
          */
diff --git a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/CaffeineLoadCacheEndpointBuilderFactory.java b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/CaffeineLoadCacheEndpointBuilderFactory.java
index 1618404..67afb32 100644
--- a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/CaffeineLoadCacheEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/CaffeineLoadCacheEndpointBuilderFactory.java
@@ -202,21 +202,7 @@ public interface CaffeineLoadCacheEndpointBuilderFactory {
         /**
          * The cache key type, default java.lang.Object.
          * 
-         * The option is a: <code>java.lang.Class&lt;java.lang.Object&gt;</code>
-         * type.
-         * 
-         * Group: advanced
-         */
-        default AdvancedCaffeineLoadCacheEndpointConsumerBuilder keyType(
-                Class<Object> keyType) {
-            setProperty("keyType", keyType);
-            return this;
-        }
-        /**
-         * The cache key type, default java.lang.Object.
-         * 
-         * The option will be converted to a
-         * <code>java.lang.Class&lt;java.lang.Object&gt;</code> type.
+         * The option is a: <code>java.lang.String</code> type.
          * 
          * Group: advanced
          */
@@ -254,21 +240,7 @@ public interface CaffeineLoadCacheEndpointBuilderFactory {
         /**
          * The cache value type, default java.lang.Object.
          * 
-         * The option is a: <code>java.lang.Class&lt;java.lang.Object&gt;</code>
-         * type.
-         * 
-         * Group: advanced
-         */
-        default AdvancedCaffeineLoadCacheEndpointConsumerBuilder valueType(
-                Class<Object> valueType) {
-            setProperty("valueType", valueType);
-            return this;
-        }
-        /**
-         * The cache value type, default java.lang.Object.
-         * 
-         * The option will be converted to a
-         * <code>java.lang.Class&lt;java.lang.Object&gt;</code> type.
+         * The option is a: <code>java.lang.String</code> type.
          * 
          * Group: advanced
          */
@@ -685,21 +657,7 @@ public interface CaffeineLoadCacheEndpointBuilderFactory {
         /**
          * The cache key type, default java.lang.Object.
          * 
-         * The option is a: <code>java.lang.Class&lt;java.lang.Object&gt;</code>
-         * type.
-         * 
-         * Group: advanced
-         */
-        default AdvancedCaffeineLoadCacheEndpointProducerBuilder keyType(
-                Class<Object> keyType) {
-            setProperty("keyType", keyType);
-            return this;
-        }
-        /**
-         * The cache key type, default java.lang.Object.
-         * 
-         * The option will be converted to a
-         * <code>java.lang.Class&lt;java.lang.Object&gt;</code> type.
+         * The option is a: <code>java.lang.String</code> type.
          * 
          * Group: advanced
          */
@@ -737,21 +695,7 @@ public interface CaffeineLoadCacheEndpointBuilderFactory {
         /**
          * The cache value type, default java.lang.Object.
          * 
-         * The option is a: <code>java.lang.Class&lt;java.lang.Object&gt;</code>
-         * type.
-         * 
-         * Group: advanced
-         */
-        default AdvancedCaffeineLoadCacheEndpointProducerBuilder valueType(
-                Class<Object> valueType) {
-            setProperty("valueType", valueType);
-            return this;
-        }
-        /**
-         * The cache value type, default java.lang.Object.
-         * 
-         * The option will be converted to a
-         * <code>java.lang.Class&lt;java.lang.Object&gt;</code> type.
+         * The option is a: <code>java.lang.String</code> type.
          * 
          * Group: advanced
          */
@@ -837,21 +781,7 @@ public interface CaffeineLoadCacheEndpointBuilderFactory {
         /**
          * The cache key type, default java.lang.Object.
          * 
-         * The option is a: <code>java.lang.Class&lt;java.lang.Object&gt;</code>
-         * type.
-         * 
-         * Group: advanced
-         */
-        default AdvancedCaffeineLoadCacheEndpointBuilder keyType(
-                Class<Object> keyType) {
-            setProperty("keyType", keyType);
-            return this;
-        }
-        /**
-         * The cache key type, default java.lang.Object.
-         * 
-         * The option will be converted to a
-         * <code>java.lang.Class&lt;java.lang.Object&gt;</code> type.
+         * The option is a: <code>java.lang.String</code> type.
          * 
          * Group: advanced
          */
@@ -888,21 +818,7 @@ public interface CaffeineLoadCacheEndpointBuilderFactory {
         /**
          * The cache value type, default java.lang.Object.
          * 
-         * The option is a: <code>java.lang.Class&lt;java.lang.Object&gt;</code>
-         * type.
-         * 
-         * Group: advanced
-         */
-        default AdvancedCaffeineLoadCacheEndpointBuilder valueType(
-                Class<Object> valueType) {
-            setProperty("valueType", valueType);
-            return this;
-        }
-        /**
-         * The cache value type, default java.lang.Object.
-         * 
-         * The option will be converted to a
-         * <code>java.lang.Class&lt;java.lang.Object&gt;</code> type.
+         * The option is a: <code>java.lang.String</code> type.
          * 
          * Group: advanced
          */
diff --git a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/ChatScriptEndpointBuilderFactory.java b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/ChatScriptEndpointBuilderFactory.java
index 7e604cf..29c269b 100644
--- a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/ChatScriptEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/ChatScriptEndpointBuilderFactory.java
@@ -40,37 +40,37 @@ public interface ChatScriptEndpointBuilderFactory {
             return (AdvancedChatScriptEndpointBuilder) this;
         }
         /**
-         * Issues :reset command to start a new conversation everytime.
+         * Username who initializes the CS conversation. To be set when chat is
+         * initialized from camel route.
          * 
-         * The option is a: <code>boolean</code> type.
+         * The option is a: <code>java.lang.String</code> type.
          * 
-         * Group: reset
+         * Group: producer
          */
-        default ChatScriptEndpointBuilder resetchat(boolean resetchat) {
-            setProperty("resetchat", resetchat);
+        default ChatScriptEndpointBuilder chatUserName(String chatUserName) {
+            setProperty("chatUserName", chatUserName);
             return this;
         }
         /**
          * Issues :reset command to start a new conversation everytime.
          * 
-         * The option will be converted to a <code>boolean</code> type.
+         * The option is a: <code>boolean</code> type.
          * 
-         * Group: reset
+         * Group: producer
          */
-        default ChatScriptEndpointBuilder resetchat(String resetchat) {
-            setProperty("resetchat", resetchat);
+        default ChatScriptEndpointBuilder resetChat(boolean resetChat) {
+            setProperty("resetChat", resetChat);
             return this;
         }
         /**
-         * Username who initializes the CS conversation. To be set when chat is
-         * initialized from camel route.
+         * Issues :reset command to start a new conversation everytime.
          * 
-         * The option is a: <code>java.lang.String</code> type.
+         * The option will be converted to a <code>boolean</code> type.
          * 
-         * Group: username
+         * Group: producer
          */
-        default ChatScriptEndpointBuilder chatUserName(String chatUserName) {
-            setProperty("chatUserName", chatUserName);
+        default ChatScriptEndpointBuilder resetChat(String resetChat) {
+            setProperty("resetChat", resetChat);
             return this;
         }
     }
diff --git a/platforms/spring-boot/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/cache/springboot/CaffeineCacheComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/cache/springboot/CaffeineCacheComponentConfiguration.java
index a1b7c20..fbefa29 100644
--- a/platforms/spring-boot/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/cache/springboot/CaffeineCacheComponentConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/cache/springboot/CaffeineCacheComponentConfiguration.java
@@ -88,11 +88,11 @@ public class CaffeineCacheComponentConfiguration
         /**
          * The cache key type, default "java.lang.Object"
          */
-        private Class keyType = java.lang.Object.class;
+        private String keyType;
         /**
          * The cache value type, default "java.lang.Object"
          */
-        private Class valueType = java.lang.Object.class;
+        private String valueType;
         /**
          * To configure an already instantiated cache to be used
          */
@@ -160,19 +160,19 @@ public class CaffeineCacheComponentConfiguration
             this.key = key;
         }
 
-        public Class getKeyType() {
+        public String getKeyType() {
             return keyType;
         }
 
-        public void setKeyType(Class keyType) {
+        public void setKeyType(String keyType) {
             this.keyType = keyType;
         }
 
-        public Class getValueType() {
+        public String getValueType() {
             return valueType;
         }
 
-        public void setValueType(Class valueType) {
+        public void setValueType(String valueType) {
             this.valueType = valueType;
         }
 
diff --git a/platforms/spring-boot/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/load/springboot/CaffeineLoadCacheComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/load/springboot/CaffeineLoadCacheComponentConfiguration.java
index 983b517..c42ad07 100644
--- a/platforms/spring-boot/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/load/springboot/CaffeineLoadCacheComponentConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/load/springboot/CaffeineLoadCacheComponentConfiguration.java
@@ -89,11 +89,11 @@ public class CaffeineLoadCacheComponentConfiguration
         /**
          * The cache key type, default "java.lang.Object"
          */
-        private Class keyType = java.lang.Object.class;
+        private String keyType;
         /**
          * The cache value type, default "java.lang.Object"
          */
-        private Class valueType = java.lang.Object.class;
+        private String valueType;
         /**
          * To configure an already instantiated cache to be used
          */
@@ -161,19 +161,19 @@ public class CaffeineLoadCacheComponentConfiguration
             this.key = key;
         }
 
-        public Class getKeyType() {
+        public String getKeyType() {
             return keyType;
         }
 
-        public void setKeyType(Class keyType) {
+        public void setKeyType(String keyType) {
             this.keyType = keyType;
         }
 
-        public Class getValueType() {
+        public String getValueType() {
             return valueType;
         }
 
-        public void setValueType(Class valueType) {
+        public void setValueType(String valueType) {
             this.valueType = valueType;
         }
 


[camel] 11/12: CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 0cd102598e0d605f045c0c56960df1e6452bf78e
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Aug 20 20:55:16 2019 +0200

    CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
---
 .../component/disruptor/DisruptorComponent.java    | 27 ++++---
 .../component/disruptor/DisruptorEndpoint.java     | 28 ++++---
 .../component/docker/DockerConfiguration.java      |  4 +-
 .../camel/component/dropbox/DropboxEndpoint.java   |  4 +
 .../src/main/docs/ehcache-component.adoc           |  4 +-
 .../component/ehcache/EhcacheConfiguration.java    | 16 ++--
 .../camel/component/ehcache/EhcacheConsumer.java   | 11 ++-
 .../camel/component/ehcache/EhcacheProducer.java   | 35 ++++++--
 .../ehcache/EhcacheComponentConfigurationTest.java |  4 +-
 .../dsl/EhcacheEndpointBuilderFactory.java         | 94 ++--------------------
 .../springboot/EhcacheComponentConfiguration.java  | 12 +--
 11 files changed, 100 insertions(+), 139 deletions(-)

diff --git a/components/camel-disruptor/src/main/java/org/apache/camel/component/disruptor/DisruptorComponent.java b/components/camel-disruptor/src/main/java/org/apache/camel/component/disruptor/DisruptorComponent.java
index f596dd0..5717fd7 100644
--- a/components/camel-disruptor/src/main/java/org/apache/camel/component/disruptor/DisruptorComponent.java
+++ b/components/camel-disruptor/src/main/java/org/apache/camel/component/disruptor/DisruptorComponent.java
@@ -93,18 +93,21 @@ public class DisruptorComponent extends DefaultComponent {
             throw new IllegalArgumentException("The 'pollTimeout' argument is not supported by the Disruptor component");
         }
 
-        final DisruptorWaitStrategy waitStrategy = getAndRemoveParameter(parameters, "waitStrategy", DisruptorWaitStrategy.class, defaultWaitStrategy);
-        final DisruptorProducerType producerType = getAndRemoveParameter(parameters, "producerType", DisruptorProducerType.class, defaultProducerType);
-        final boolean multipleConsumers = getAndRemoveParameter(parameters, "multipleConsumers", boolean.class, defaultMultipleConsumers);
-        final boolean blockWhenFull = getAndRemoveParameter(parameters, "blockWhenFull", boolean.class, defaultBlockWhenFull);
-
-        final DisruptorReference disruptorReference = getOrCreateDisruptor(uri, remaining, size, producerType, waitStrategy);
-        final DisruptorEndpoint disruptorEndpoint = new DisruptorEndpoint(uri, this, disruptorReference, concurrentConsumers, multipleConsumers, blockWhenFull);
-        disruptorEndpoint.setWaitStrategy(waitStrategy);
-        disruptorEndpoint.setProducerType(producerType);
-        disruptorEndpoint.configureProperties(parameters);
-
-        return disruptorEndpoint;
+        DisruptorWaitStrategy waitStrategy = getAndRemoveParameter(parameters, "waitStrategy", DisruptorWaitStrategy.class, defaultWaitStrategy);
+        DisruptorProducerType producerType = getAndRemoveParameter(parameters, "producerType", DisruptorProducerType.class, defaultProducerType);
+        boolean multipleConsumers = getAndRemoveParameter(parameters, "multipleConsumers", boolean.class, defaultMultipleConsumers);
+        boolean blockWhenFull = getAndRemoveParameter(parameters, "blockWhenFull", boolean.class, defaultBlockWhenFull);
+
+        DisruptorReference disruptorReference = getOrCreateDisruptor(uri, remaining, size, producerType, waitStrategy);
+        DisruptorEndpoint answer = new DisruptorEndpoint(uri, this, disruptorReference);
+        answer.setConcurrentConsumers(concurrentConsumers);
+        answer.setMultipleConsumers(multipleConsumers);
+        answer.setBlockWhenFull(blockWhenFull);
+        answer.setWaitStrategy(waitStrategy);
+        answer.setProducerType(producerType);
+        answer.configureProperties(parameters);
+
+        return answer;
     }
 
     private DisruptorReference getOrCreateDisruptor(final String uri, final String name, final int size,
diff --git a/components/camel-disruptor/src/main/java/org/apache/camel/component/disruptor/DisruptorEndpoint.java b/components/camel-disruptor/src/main/java/org/apache/camel/component/disruptor/DisruptorEndpoint.java
index 9b81e7f..d5dcdcd 100644
--- a/components/camel-disruptor/src/main/java/org/apache/camel/component/disruptor/DisruptorEndpoint.java
+++ b/components/camel-disruptor/src/main/java/org/apache/camel/component/disruptor/DisruptorEndpoint.java
@@ -61,9 +61,9 @@ public class DisruptorEndpoint extends DefaultEndpoint implements AsyncEndpoint,
     @UriPath(description = "Name of queue") @Metadata(required = true)
     private String name;
     @UriParam(label = "consumer", defaultValue = "1")
-    private final int concurrentConsumers;
+    private int concurrentConsumers;
     @UriParam(label = "consumer")
-    private final boolean multipleConsumers;
+    private boolean multipleConsumers;
     @UriParam(label = "producer", defaultValue = "IfReplyExpected")
     private WaitForTaskToComplete waitForTaskToComplete = WaitForTaskToComplete.IfReplyExpected;
     @UriParam(label = "producer", defaultValue = "30000")
@@ -78,14 +78,10 @@ public class DisruptorEndpoint extends DefaultEndpoint implements AsyncEndpoint,
     private DisruptorProducerType producerType;
 
     public DisruptorEndpoint(final String endpointUri, final Component component,
-                             final DisruptorReference disruptorReference, final int concurrentConsumers,
-                             final boolean multipleConsumers, boolean blockWhenFull) throws Exception {
+                             final DisruptorReference disruptorReference) {
         super(endpointUri, component);
         this.disruptorReference = disruptorReference;
         this.name = disruptorReference.getName();
-        this.concurrentConsumers = concurrentConsumers;
-        this.multipleConsumers = multipleConsumers;
-        this.blockWhenFull = blockWhenFull;
     }
 
     @ManagedAttribute(description = "Queue name")
@@ -108,14 +104,18 @@ public class DisruptorEndpoint extends DefaultEndpoint implements AsyncEndpoint,
         return getDisruptor().getPendingExchangeCount();
     }
 
-    /**
-     * Number of concurrent threads processing exchanges.
-     */
     @ManagedAttribute(description = "Number of concurrent consumers")
     public int getConcurrentConsumers() {
         return concurrentConsumers;
     }
 
+    /**
+     * Number of concurrent threads processing exchanges.
+     */
+    public void setConcurrentConsumers(int concurrentConsumers) {
+        this.concurrentConsumers = concurrentConsumers;
+    }
+
     @ManagedAttribute(description = "Option to specify whether the caller should wait for the async task to complete or not before continuing")
     public WaitForTaskToComplete getWaitForTaskToComplete() {
         return waitForTaskToComplete;
@@ -165,14 +165,18 @@ public class DisruptorEndpoint extends DefaultEndpoint implements AsyncEndpoint,
         return isMultipleConsumers();
     }
 
+    public boolean isMultipleConsumers() {
+        return multipleConsumers;
+    }
+
     /**
      * Specifies whether multiple consumers are allowed.
      * If enabled, you can use Disruptor for Publish-Subscribe messaging.
      * That is, you can send a message to the queue and have each consumer receive a copy of the message.
      * When enabled, this option should be specified on every consumer endpoint.
      */
-    public boolean isMultipleConsumers() {
-        return multipleConsumers;
+    public void setMultipleConsumers(boolean multipleConsumers) {
+        this.multipleConsumers = multipleConsumers;
     }
 
     /**
diff --git a/components/camel-docker/src/main/java/org/apache/camel/component/docker/DockerConfiguration.java b/components/camel-docker/src/main/java/org/apache/camel/component/docker/DockerConfiguration.java
index dab3b54..b5ebf30 100644
--- a/components/camel-docker/src/main/java/org/apache/camel/component/docker/DockerConfiguration.java
+++ b/components/camel-docker/src/main/java/org/apache/camel/component/docker/DockerConfiguration.java
@@ -189,7 +189,7 @@ public class DockerConfiguration implements Cloneable {
         this.maxPerRouteConnections = maxPerRouteConnections;
     }
 
-    public boolean isLoggingFilterEnabled() {
+    public boolean isLoggingFilter() {
         return loggingFilter;
     }
 
@@ -200,7 +200,7 @@ public class DockerConfiguration implements Cloneable {
         this.loggingFilter = loggingFilterEnabled;
     }
 
-    public boolean isFollowRedirectFilterEnabled() {
+    public boolean isFollowRedirectFilter() {
         return followRedirectFilter;
     }
 
diff --git a/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/DropboxEndpoint.java b/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/DropboxEndpoint.java
index 07cfca3..379723b 100644
--- a/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/DropboxEndpoint.java
+++ b/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/DropboxEndpoint.java
@@ -55,6 +55,10 @@ public class DropboxEndpoint extends DefaultEndpoint {
         this.configuration = configuration;
     }
 
+    public DropboxConfiguration getConfiguration() {
+        return configuration;
+    }
+
     /**
      * Create one of the camel producer available based on the configuration
      * @return the camel producer
diff --git a/components/camel-ehcache/src/main/docs/ehcache-component.adoc b/components/camel-ehcache/src/main/docs/ehcache-component.adoc
index 7554c48..950b0af 100644
--- a/components/camel-ehcache/src/main/docs/ehcache-component.adoc
+++ b/components/camel-ehcache/src/main/docs/ehcache-component.adoc
@@ -98,9 +98,9 @@ with the following path and query parameters:
 | *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
 | *configuration* (advanced) | The default cache configuration to be used to create caches. |  | CacheConfiguration
 | *configurations* (advanced) | A map of cache configuration to be used to create caches. |  | Map
-| *keyType* (advanced) | The cache key type, default java.lang.Object | java.lang.Object | String
+| *keyType* (advanced) | The cache key type, default java.lang.Object |  | String
 | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean
-| *valueType* (advanced) | The cache value type, default java.lang.Object | java.lang.Object | String
+| *valueType* (advanced) | The cache value type, default java.lang.Object |  | String
 |===
 // endpoint options: END
 // spring-boot-auto-configure options: START
diff --git a/components/camel-ehcache/src/main/java/org/apache/camel/component/ehcache/EhcacheConfiguration.java b/components/camel-ehcache/src/main/java/org/apache/camel/component/ehcache/EhcacheConfiguration.java
index d3922ce..df368a8 100644
--- a/components/camel-ehcache/src/main/java/org/apache/camel/component/ehcache/EhcacheConfiguration.java
+++ b/components/camel-ehcache/src/main/java/org/apache/camel/component/ehcache/EhcacheConfiguration.java
@@ -53,10 +53,10 @@ public class EhcacheConfiguration implements Cloneable {
     private CacheConfiguration configuration;
     @UriParam(label = "advanced")
     private Map<String, CacheConfiguration> configurations;
-    @UriParam(label = "advanced", javaType = "java.lang.String", defaultValue = "java.lang.Object")
-    private Class<?> keyType;
-    @UriParam(label = "advanced", javaType = "java.lang.String", defaultValue = "java.lang.Object")
-    private Class<?> valueType;
+    @UriParam(label = "advanced")
+    private String keyType;
+    @UriParam(label = "advanced")
+    private String valueType;
     @UriParam(label = "consumer", defaultValue = "ORDERED")
     private EventOrdering eventOrdering = EventOrdering.ORDERED;
     @UriParam(label = "consumer", defaultValue = "ASYNCHRONOUS")
@@ -260,25 +260,25 @@ public class EhcacheConfiguration implements Cloneable {
         this.configurations.putAll(configurations);
     }
 
-    public Class<?> getKeyType() {
+    public String getKeyType() {
         return keyType;
     }
 
     /**
      * The cache key type, default "java.lang.Object"
      */
-    public void setKeyType(Class<?> keyType) {
+    public void setKeyType(String keyType) {
         this.keyType = keyType;
     }
 
-    public Class<?> getValueType() {
+    public String getValueType() {
         return valueType;
     }
 
     /**
      * The cache value type, default "java.lang.Object"
      */
-    public void setValueType(Class<?> valueType) {
+    public void setValueType(String valueType) {
         this.valueType = valueType;
     }
 
diff --git a/components/camel-ehcache/src/main/java/org/apache/camel/component/ehcache/EhcacheConsumer.java b/components/camel-ehcache/src/main/java/org/apache/camel/component/ehcache/EhcacheConsumer.java
index df73f86..a6263c4 100644
--- a/components/camel-ehcache/src/main/java/org/apache/camel/component/ehcache/EhcacheConsumer.java
+++ b/components/camel-ehcache/src/main/java/org/apache/camel/component/ehcache/EhcacheConsumer.java
@@ -34,7 +34,16 @@ public class EhcacheConsumer extends DefaultConsumer implements CacheEventListen
 
         this.configuration = configuration;
         this.manager = endpoint.getManager();
-        this.cache = manager.getCache(cacheName, configuration.getKeyType(), configuration.getValueType());
+
+        Class<?> kt = null;
+        if (configuration.getKeyType() != null) {
+            kt = getEndpoint().getCamelContext().getClassResolver().resolveClass(configuration.getKeyType());
+        }
+        Class<?> vt = null;
+        if (configuration.getValueType() != null) {
+            vt = getEndpoint().getCamelContext().getClassResolver().resolveClass(configuration.getValueType());
+        }
+        this.cache = manager.getCache(cacheName, kt, vt);
     }
 
     @Override
diff --git a/components/camel-ehcache/src/main/java/org/apache/camel/component/ehcache/EhcacheProducer.java b/components/camel-ehcache/src/main/java/org/apache/camel/component/ehcache/EhcacheProducer.java
index 0f8cea4..e5a4f94 100644
--- a/components/camel-ehcache/src/main/java/org/apache/camel/component/ehcache/EhcacheProducer.java
+++ b/components/camel-ehcache/src/main/java/org/apache/camel/component/ehcache/EhcacheProducer.java
@@ -32,11 +32,20 @@ public class EhcacheProducer extends HeaderSelectorProducer {
     private final Cache cache;
 
     public EhcacheProducer(EhcacheEndpoint endpoint, String cacheName, EhcacheConfiguration configuration) throws Exception {
-        super(endpoint, EhcacheConstants.ACTION, () -> configuration.getAction());
+        super(endpoint, EhcacheConstants.ACTION, configuration::getAction);
 
         this.configuration = configuration;
         this.manager = endpoint.getManager();
-        this.cache = manager.getCache(cacheName, configuration.getKeyType(), configuration.getValueType());
+
+        Class<?> kt = null;
+        if (configuration.getKeyType() != null) {
+            kt = getEndpoint().getCamelContext().getClassResolver().resolveClass(configuration.getKeyType());
+        }
+        Class<?> vt = null;
+        if (configuration.getValueType() != null) {
+            vt = getEndpoint().getCamelContext().getClassResolver().resolveClass(configuration.getValueType());
+        }
+        this.cache = manager.getCache(cacheName, kt, vt);
     }
     
     // ****************************
@@ -130,7 +139,13 @@ public class EhcacheProducer extends HeaderSelectorProducer {
     // ****************************
 
     private Object getKey(final Message message) throws Exception {
-        Object value = message.getHeader(EhcacheConstants.KEY, cache.getRuntimeConfiguration().getKeyType());
+        Object value;
+        if (configuration.getKeyType() != null) {
+            Class<?> clazz = getEndpoint().getCamelContext().getClassResolver().resolveClass(configuration.getKeyType());
+            value = message.getHeader(EhcacheConstants.KEY, clazz);
+        } else {
+            value = message.getHeader(EhcacheConstants.KEY);
+        }
         if (value == null) {
             value = configuration.getKey();
         }
@@ -145,10 +160,18 @@ public class EhcacheProducer extends HeaderSelectorProducer {
         return value;
     }
 
-    private Object getValue(final Message message, final Class<?> type)  throws Exception {
-        Object value = message.getHeader(EhcacheConstants.VALUE, type);
+    @SuppressWarnings("unchecked")
+    private Object getValue(final Message message, final Object type)  throws Exception {
+        Object value = message.getHeader(EhcacheConstants.VALUE);
         if (value == null) {
-            value = message.getBody(type);
+            if (type instanceof String) {
+                Class<?> clazz = getEndpoint().getCamelContext().getClassResolver().resolveClass((String) type);
+                value = message.getBody(clazz);
+            } else if (type instanceof Class) {
+                value = message.getBody((Class) type);
+            } else {
+                value = message.getBody();
+            }
         }
 
         if (value == null) {
diff --git a/components/camel-ehcache/src/test/java/org/apache/camel/component/ehcache/EhcacheComponentConfigurationTest.java b/components/camel-ehcache/src/test/java/org/apache/camel/component/ehcache/EhcacheComponentConfigurationTest.java
index bd450b4..01db7f5 100644
--- a/components/camel-ehcache/src/test/java/org/apache/camel/component/ehcache/EhcacheComponentConfigurationTest.java
+++ b/components/camel-ehcache/src/test/java/org/apache/camel/component/ehcache/EhcacheComponentConfigurationTest.java
@@ -39,8 +39,8 @@ public class EhcacheComponentConfigurationTest extends CamelTestSupport {
     @BindToRegistry("ehcache")
     public Component createEhcacheComponent() throws Exception {
         EhcacheComponent component = new EhcacheComponent();
-        component.getConfiguration().setKeyType(String.class);
-        component.getConfiguration().setValueType(String.class);
+        component.getConfiguration().setKeyType("java.lang.String");
+        component.getConfiguration().setValueType("java.lang.String");
         component.getConfiguration().setCacheManager(
             CacheManagerBuilder.newCacheManagerBuilder()
                 .withCache(
diff --git a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/EhcacheEndpointBuilderFactory.java b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/EhcacheEndpointBuilderFactory.java
index f800339..9c29554 100644
--- a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/EhcacheEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/EhcacheEndpointBuilderFactory.java
@@ -393,21 +393,7 @@ public interface EhcacheEndpointBuilderFactory {
         /**
          * The cache key type, default java.lang.Object.
          * 
-         * The option is a: <code>java.lang.Class&lt;java.lang.Object&gt;</code>
-         * type.
-         * 
-         * Group: advanced
-         */
-        default AdvancedEhcacheEndpointConsumerBuilder keyType(
-                Class<Object> keyType) {
-            setProperty("keyType", keyType);
-            return this;
-        }
-        /**
-         * The cache key type, default java.lang.Object.
-         * 
-         * The option will be converted to a
-         * <code>java.lang.Class&lt;java.lang.Object&gt;</code> type.
+         * The option is a: <code>java.lang.String</code> type.
          * 
          * Group: advanced
          */
@@ -444,21 +430,7 @@ public interface EhcacheEndpointBuilderFactory {
         /**
          * The cache value type, default java.lang.Object.
          * 
-         * The option is a: <code>java.lang.Class&lt;java.lang.Object&gt;</code>
-         * type.
-         * 
-         * Group: advanced
-         */
-        default AdvancedEhcacheEndpointConsumerBuilder valueType(
-                Class<Object> valueType) {
-            setProperty("valueType", valueType);
-            return this;
-        }
-        /**
-         * The cache value type, default java.lang.Object.
-         * 
-         * The option will be converted to a
-         * <code>java.lang.Class&lt;java.lang.Object&gt;</code> type.
+         * The option is a: <code>java.lang.String</code> type.
          * 
          * Group: advanced
          */
@@ -736,21 +708,7 @@ public interface EhcacheEndpointBuilderFactory {
         /**
          * The cache key type, default java.lang.Object.
          * 
-         * The option is a: <code>java.lang.Class&lt;java.lang.Object&gt;</code>
-         * type.
-         * 
-         * Group: advanced
-         */
-        default AdvancedEhcacheEndpointProducerBuilder keyType(
-                Class<Object> keyType) {
-            setProperty("keyType", keyType);
-            return this;
-        }
-        /**
-         * The cache key type, default java.lang.Object.
-         * 
-         * The option will be converted to a
-         * <code>java.lang.Class&lt;java.lang.Object&gt;</code> type.
+         * The option is a: <code>java.lang.String</code> type.
          * 
          * Group: advanced
          */
@@ -787,21 +745,7 @@ public interface EhcacheEndpointBuilderFactory {
         /**
          * The cache value type, default java.lang.Object.
          * 
-         * The option is a: <code>java.lang.Class&lt;java.lang.Object&gt;</code>
-         * type.
-         * 
-         * Group: advanced
-         */
-        default AdvancedEhcacheEndpointProducerBuilder valueType(
-                Class<Object> valueType) {
-            setProperty("valueType", valueType);
-            return this;
-        }
-        /**
-         * The cache value type, default java.lang.Object.
-         * 
-         * The option will be converted to a
-         * <code>java.lang.Class&lt;java.lang.Object&gt;</code> type.
+         * The option is a: <code>java.lang.String</code> type.
          * 
          * Group: advanced
          */
@@ -1002,20 +946,7 @@ public interface EhcacheEndpointBuilderFactory {
         /**
          * The cache key type, default java.lang.Object.
          * 
-         * The option is a: <code>java.lang.Class&lt;java.lang.Object&gt;</code>
-         * type.
-         * 
-         * Group: advanced
-         */
-        default AdvancedEhcacheEndpointBuilder keyType(Class<Object> keyType) {
-            setProperty("keyType", keyType);
-            return this;
-        }
-        /**
-         * The cache key type, default java.lang.Object.
-         * 
-         * The option will be converted to a
-         * <code>java.lang.Class&lt;java.lang.Object&gt;</code> type.
+         * The option is a: <code>java.lang.String</code> type.
          * 
          * Group: advanced
          */
@@ -1050,20 +981,7 @@ public interface EhcacheEndpointBuilderFactory {
         /**
          * The cache value type, default java.lang.Object.
          * 
-         * The option is a: <code>java.lang.Class&lt;java.lang.Object&gt;</code>
-         * type.
-         * 
-         * Group: advanced
-         */
-        default AdvancedEhcacheEndpointBuilder valueType(Class<Object> valueType) {
-            setProperty("valueType", valueType);
-            return this;
-        }
-        /**
-         * The cache value type, default java.lang.Object.
-         * 
-         * The option will be converted to a
-         * <code>java.lang.Class&lt;java.lang.Object&gt;</code> type.
+         * The option is a: <code>java.lang.String</code> type.
          * 
          * Group: advanced
          */
diff --git a/platforms/spring-boot/components-starter/camel-ehcache-starter/src/main/java/org/apache/camel/component/ehcache/springboot/EhcacheComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-ehcache-starter/src/main/java/org/apache/camel/component/ehcache/springboot/EhcacheComponentConfiguration.java
index 230c4bc..11432b9 100644
--- a/platforms/spring-boot/components-starter/camel-ehcache-starter/src/main/java/org/apache/camel/component/ehcache/springboot/EhcacheComponentConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-ehcache-starter/src/main/java/org/apache/camel/component/ehcache/springboot/EhcacheComponentConfiguration.java
@@ -192,11 +192,11 @@ public class EhcacheComponentConfiguration
         /**
          * The cache key type, default "java.lang.Object"
          */
-        private Class keyType = java.lang.Object.class;
+        private String keyType;
         /**
          * The cache value type, default "java.lang.Object"
          */
-        private Class valueType = java.lang.Object.class;
+        private String valueType;
 
         public String getConfigurationUri() {
             return configurationUri;
@@ -298,19 +298,19 @@ public class EhcacheComponentConfiguration
             this.configurations = configurations;
         }
 
-        public Class getKeyType() {
+        public String getKeyType() {
             return keyType;
         }
 
-        public void setKeyType(Class keyType) {
+        public void setKeyType(String keyType) {
             this.keyType = keyType;
         }
 
-        public Class getValueType() {
+        public String getValueType() {
             return valueType;
         }
 
-        public void setValueType(Class valueType) {
+        public void setValueType(String valueType) {
             this.valueType = valueType;
         }
     }


[camel] 04/12: CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 6c3447ff272ae76bb26bd344aee4062a75017c3b
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Aug 20 11:19:03 2019 +0200

    CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
---
 .../org/apache/camel/support/DefaultComponent.java     |  4 ++--
 .../camel/tools/apt/EndpointAnnotationProcessor.java   |  1 +
 .../tools/apt/EndpointPropertyConfigurerGenerator.java | 18 ++++++++++++++++++
 3 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java b/core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java
index eecb64c..866f9a6 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java
@@ -57,7 +57,7 @@ public abstract class DefaultComponent extends ServiceSupport implements Compone
      */
     private static final Pattern RAW_PATTERN = Pattern.compile("RAW[({].*&&.*[)}]");
 
-    private static final String RESOURCE_PATH = "META-INF/services/org/apache/camel/component/";
+    private static final String RESOURCE_PATH = "META-INF/services/org/apache/camel/configurer/";
 
     private volatile Class endpointPropertyConfigurerClass;
 
@@ -335,7 +335,7 @@ public abstract class DefaultComponent extends ServiceSupport implements Compone
             String name = ann.value();
             try {
                 Optional<Class<?>> clazz = getCamelContext().getExtension(ExtendedCamelContext.class).getFactoryFinder(RESOURCE_PATH)
-                        .findOptionalClass(name, "endpoint-property-configurer-");
+                        .findOptionalClass(name + "-endpoint", null);
                 clazz.ifPresent(aClass -> endpointPropertyConfigurerClass = aClass);
             } catch (NoFactoryAvailableException e) {
                 // ignore
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
index e8d2f01..361bcef 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
@@ -181,6 +181,7 @@ public class EndpointAnnotationProcessor extends AbstractCamelAnnotationProcesso
         String fqn = pn + "." + cn;
 
         EndpointPropertyConfigurerGenerator.generatePropertyConfigurer(processingEnv, parent, pn, cn, fqn, en, fqen, endpointPaths, endpointOptions);
+        EndpointPropertyConfigurerGenerator.generateMetaInfConfigurer(processingEnv, componentModel.getScheme() + "-endpoint", fqn);
     }
 
     public String createParameterJsonSchema(ComponentModel componentModel, Set<ComponentOption> componentOptions,
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointPropertyConfigurerGenerator.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointPropertyConfigurerGenerator.java
index fb3001a..6e4e236 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointPropertyConfigurerGenerator.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointPropertyConfigurerGenerator.java
@@ -16,13 +16,18 @@
  */
 package org.apache.camel.tools.apt;
 
+import java.io.IOException;
 import java.io.Writer;
 import java.util.Set;
 import javax.annotation.processing.ProcessingEnvironment;
+import javax.lang.model.element.AnnotationMirror;
 import javax.lang.model.element.TypeElement;
 import javax.tools.Diagnostic;
+import javax.tools.FileObject;
 import javax.tools.JavaFileObject;
+import javax.tools.StandardLocation;
 
+import org.apache.camel.spi.annotations.SubServiceFactory;
 import org.apache.camel.tools.apt.helper.IOHelper;
 import org.apache.camel.tools.apt.model.EndpointOption;
 import org.apache.camel.tools.apt.model.EndpointPath;
@@ -128,4 +133,17 @@ public final class EndpointPropertyConfigurerGenerator {
         return sb.toString();
     }
 
+    public static void generateMetaInfConfigurer(ProcessingEnvironment processingEnv, String name, String fqn) {
+        try {
+            FileObject resource = processingEnv.getFiler().createResource(StandardLocation.CLASS_OUTPUT, "",
+                    "META-INF/services/org/apache/camel/configurer/" + name);
+            try (Writer w = resource.openWriter()) {
+                w.append("# Generated by camel annotation processor\n");
+                w.append("class=").append(fqn).append("\n");
+            }
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
 }


[camel] 02/12: CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 1d4c0977110ddffe1ec6d41b21b2eed10a8a6b24
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Aug 20 09:16:24 2019 +0200

    CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
---
 .../apache/camel/component/log/LogEndpoint.java    |   6 ++
 .../camel/component/log/LogEndpointConfigurer.java |  50 +++++++++
 .../apache/camel/spi/PropertyConfigurerAware.java  |  23 ++++
 .../camel/processor/SimpleMockPlaceholderTest.java |   2 +-
 .../org/apache/camel/support/DefaultComponent.java |   8 +-
 .../org/apache/camel/support/DefaultEndpoint.java  |  15 ++-
 .../camel/support/PropertyBindingSupport.java      |  51 +++++++--
 .../apache/camel/itest/jmh/LogEndpointTest.java    | 102 ++++++++++++++++++
 .../camel/itest/jmh/SimpleMockPlaceholderTest.java | 117 +++++++++++++++++++++
 .../camel-jmh/src/test/resources/log4j2.properties |   2 +-
 10 files changed, 363 insertions(+), 13 deletions(-)

diff --git a/components/camel-log/src/main/java/org/apache/camel/component/log/LogEndpoint.java b/components/camel-log/src/main/java/org/apache/camel/component/log/LogEndpoint.java
index 5c53d5d..f7119d7 100644
--- a/components/camel-log/src/main/java/org/apache/camel/component/log/LogEndpoint.java
+++ b/components/camel-log/src/main/java/org/apache/camel/component/log/LogEndpoint.java
@@ -25,6 +25,7 @@ import org.apache.camel.spi.CamelLogger;
 import org.apache.camel.spi.ExchangeFormatter;
 import org.apache.camel.spi.MaskingFormatter;
 import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.PropertyConfigurer;
 import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriPath;
@@ -81,6 +82,11 @@ public class LogEndpoint extends ProcessorEndpoint {
     }
 
     @Override
+    public PropertyConfigurer getPropertyConfigurer() {
+        return new LogEndpointConfigurer(this, getCamelContext());
+    }
+
+    @Override
     protected void doStart() throws Exception {
         if (logger == null) {
             logger = createLogger();
diff --git a/components/camel-log/src/main/java/org/apache/camel/component/log/LogEndpointConfigurer.java b/components/camel-log/src/main/java/org/apache/camel/component/log/LogEndpointConfigurer.java
new file mode 100644
index 0000000..206d10c
--- /dev/null
+++ b/components/camel-log/src/main/java/org/apache/camel/component/log/LogEndpointConfigurer.java
@@ -0,0 +1,50 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.log;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.function.Consumer;
+import java.util.function.Supplier;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.spi.PropertyConfigurer;
+
+public class LogEndpointConfigurer implements PropertyConfigurer<Object> {
+
+    private final Map<String, Supplier<Object>> readPlaceholders = new HashMap<>();
+    private final Map<String, Consumer<Object>> writePlaceholders = new HashMap<>();
+
+    public LogEndpointConfigurer(final Object target, final CamelContext camelContext) {
+        final LogEndpoint endpoint = (LogEndpoint) target;
+
+        readPlaceholders.put("loggerName", endpoint::getLoggerName);
+        writePlaceholders.put("loggerName", o -> endpoint.setLoggerName(camelContext.getTypeConverter().convertTo(String.class, o)));
+        readPlaceholders.put("groupSize", endpoint::getGroupSize);
+        writePlaceholders.put("groupSize", o -> endpoint.setGroupSize(camelContext.getTypeConverter().convertTo(Integer.class, o)));
+    }
+
+    @Override
+    public Map<String, Supplier<Object>> getReadPropertyPlaceholderOptions(CamelContext camelContext) {
+        return readPlaceholders;
+    }
+
+    @Override
+    public Map<String, Consumer<Object>> getWritePropertyPlaceholderOptions(CamelContext camelContext) {
+        return writePlaceholders;
+    }
+}
diff --git a/core/camel-api/src/main/java/org/apache/camel/spi/PropertyConfigurerAware.java b/core/camel-api/src/main/java/org/apache/camel/spi/PropertyConfigurerAware.java
new file mode 100644
index 0000000..7223e41
--- /dev/null
+++ b/core/camel-api/src/main/java/org/apache/camel/spi/PropertyConfigurerAware.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.spi;
+
+public interface PropertyConfigurerAware {
+
+    PropertyConfigurer getPropertyConfigurer();
+
+}
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/SimpleMockPlaceholderTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/SimpleMockPlaceholderTest.java
index dd8b986..be92152 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/SimpleMockPlaceholderTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/SimpleMockPlaceholderTest.java
@@ -68,7 +68,7 @@ public class SimpleMockPlaceholderTest extends ContextTestSupport {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").to("{{foo}}").to("log:bar").to("mock:{{end}}");
+                from("direct:start?block=true").to("{{foo}}").to("log:bar?groupSize=3").to("mock:{{end}}");
             }
         };
     }
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java b/core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java
index 7d4b73d..591260d 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java
@@ -34,6 +34,8 @@ import org.apache.camel.Endpoint;
 import org.apache.camel.ResolveEndpointFailedException;
 import org.apache.camel.component.extension.ComponentExtension;
 import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.PropertyConfigurer;
+import org.apache.camel.spi.PropertyConfigurerAware;
 import org.apache.camel.support.service.ServiceSupport;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.URISupport;
@@ -366,8 +368,12 @@ public abstract class DefaultComponent extends ServiceSupport implements Compone
                     .withPlaceholder(false).withNesting(false).withDeepNesting(false).withReference(false)
                     .bind(camelContext, bean, parameters);
         } else {
+            PropertyConfigurer configurer = null;
+            if (bean instanceof PropertyConfigurerAware) {
+                configurer = ((PropertyConfigurerAware) bean).getPropertyConfigurer();
+            }
             // use advanced binding
-            PropertyBindingSupport.build().bind(camelContext, bean, parameters);
+            PropertyBindingSupport.build().withConfigurer(configurer).bind(camelContext, bean, parameters);
         }
     }
 
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/DefaultEndpoint.java b/core/camel-support/src/main/java/org/apache/camel/support/DefaultEndpoint.java
index a57354f..d4d502f 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/DefaultEndpoint.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/DefaultEndpoint.java
@@ -32,6 +32,8 @@ import org.apache.camel.Producer;
 import org.apache.camel.ResolveEndpointFailedException;
 import org.apache.camel.spi.ExceptionHandler;
 import org.apache.camel.spi.HasId;
+import org.apache.camel.spi.PropertyConfigurer;
+import org.apache.camel.spi.PropertyConfigurerAware;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.support.service.ServiceSupport;
 import org.apache.camel.util.ObjectHelper;
@@ -49,7 +51,7 @@ import org.apache.camel.util.URISupport;
  * model or not. The option is default <tt>false</tt> which means asynchronous
  * processing is allowed.
  */
-public abstract class DefaultEndpoint extends ServiceSupport implements Endpoint, HasId, CamelContextAware {
+public abstract class DefaultEndpoint extends ServiceSupport implements Endpoint, HasId, CamelContextAware, PropertyConfigurerAware {
 
     private final String id = EndpointHelper.createEndpointId();
     private transient String endpointUriToString;
@@ -415,11 +417,20 @@ public abstract class DefaultEndpoint extends ServiceSupport implements Endpoint
                     .withPlaceholder(false).withNesting(false).withDeepNesting(false).withReference(false)
                     .bind(camelContext, bean, parameters);
         } else {
+            PropertyConfigurer configurer = null;
+            if (bean instanceof PropertyConfigurerAware) {
+                configurer = ((PropertyConfigurerAware) bean).getPropertyConfigurer();
+            }
             // use advanced binding
-            PropertyBindingSupport.build().bind(camelContext, bean, parameters);
+            PropertyBindingSupport.build().withConfigurer(configurer).bind(camelContext, bean, parameters);
         }
     }
 
+    @Override
+    public PropertyConfigurer getPropertyConfigurer() {
+        return null;
+    }
+
     /**
      * A factory method to lazily create the endpointUri if none is specified
      */
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java b/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
index 9060837..11ffbcc 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
@@ -25,9 +25,12 @@ import java.util.List;
 import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
+import java.util.function.Consumer;
+import java.util.function.Supplier;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.PropertyBindingException;
+import org.apache.camel.spi.PropertyConfigurer;
 import org.apache.camel.util.StringHelper;
 
 import static org.apache.camel.support.IntrospectionSupport.findSetterMethods;
@@ -73,6 +76,7 @@ public final class PropertyBindingSupport {
         private boolean allowPrivateSetter = true;
         private boolean ignoreCase;
         private String optionPrefix;
+        private PropertyConfigurer configurer;
 
         /**
          * CamelContext to be used
@@ -200,6 +204,14 @@ public final class PropertyBindingSupport {
         }
 
         /**
+         * Whether to use the configurer to configure the properties.
+         */
+        public Builder withConfigurer(PropertyConfigurer configurer) {
+            this.configurer = configurer;
+            return this;
+        }
+
+        /**
          * Binds the properties to the target object, and removes the property that was bound from properties.
          *
          * @return  true if one or more properties was bound
@@ -211,7 +223,7 @@ public final class PropertyBindingSupport {
             org.apache.camel.util.ObjectHelper.notNull(properties, "properties");
 
             return doBindProperties(camelContext, target, properties, optionPrefix, ignoreCase, removeParameters, mandatory,
-                    nesting, deepNesting, fluentBuilder, allowPrivateSetter, reference, placeholder);
+                    nesting, deepNesting, fluentBuilder, allowPrivateSetter, reference, placeholder, configurer);
         }
 
         /**
@@ -233,7 +245,7 @@ public final class PropertyBindingSupport {
             org.apache.camel.util.ObjectHelper.notNull(prop, "properties");
 
             return doBindProperties(context, obj, prop, optionPrefix, ignoreCase, removeParameters, mandatory,
-                    nesting, deepNesting, fluentBuilder, allowPrivateSetter, reference, placeholder);
+                    nesting, deepNesting, fluentBuilder, allowPrivateSetter, reference, placeholder, configurer);
         }
 
         /**
@@ -255,7 +267,7 @@ public final class PropertyBindingSupport {
             properties.put(key, value);
 
             return doBindProperties(camelContext, target, properties, optionPrefix, ignoreCase, removeParameters, mandatory,
-                    nesting, deepNesting, fluentBuilder, allowPrivateSetter, reference, placeholder);
+                    nesting, deepNesting, fluentBuilder, allowPrivateSetter, reference, placeholder, configurer);
         }
 
     }
@@ -424,7 +436,7 @@ public final class PropertyBindingSupport {
      * @param optionPrefix        the prefix used to filter properties
      * @param ignoreCase          whether to ignore case for property keys
      * @param removeParameter     whether to remove bound parameters
-     * @param madatory            whether all parameters must be bound
+     * @param mandatory           whether all parameters must be bound
      * @param nesting             whether nesting is in use
      * @param deepNesting         whether deep nesting is in use, where Camel will attempt to walk as deep as possible by creating new objects in the OGNL graph if
      *                            a property has a setter and the object can be created from a default no-arg constructor.
@@ -432,21 +444,44 @@ public final class PropertyBindingSupport {
      * @param allowPrivateSetter  whether autowiring components allows to use private setter method when setting the value
      * @param reference           whether reference parameter (syntax starts with #) is in use
      * @param placeholder         whether to use Camels property placeholder to resolve placeholders on keys and values
+     * @param configurer          to use an optional {@link org.apache.camel.spi.PropertyConfigurer} to configure the properties
      * @return                    true if one or more properties was bound
      */
     private static boolean doBindProperties(CamelContext camelContext, Object target, Map<String, Object> properties,
-                                            String optionPrefix, boolean ignoreCase, boolean removeParameter, boolean madatory,
+                                            String optionPrefix, boolean ignoreCase, boolean removeParameter, boolean mandatory,
                                             boolean nesting, boolean deepNesting, boolean fluentBuilder, boolean allowPrivateSetter,
-                                            boolean reference, boolean placeholder) {
+                                            boolean reference, boolean placeholder,
+                                            PropertyConfigurer configurer) {
         org.apache.camel.util.ObjectHelper.notNull(camelContext, "camelContext");
         org.apache.camel.util.ObjectHelper.notNull(target, "target");
         org.apache.camel.util.ObjectHelper.notNull(properties, "properties");
         boolean rc = false;
 
+        // TODO: quick and dirty to only use configurer
+        if (configurer != null) {
+            Map<String, Consumer<Object>> writeProperties = configurer.getWritePropertyPlaceholderOptions(camelContext);
+            for (Iterator<Map.Entry<String, Object>> iter = properties.entrySet().iterator(); iter.hasNext();) {
+                Map.Entry<String, Object> entry = iter.next();
+                String key = entry.getKey();
+                Object value = entry.getValue();
+                if (writeProperties.containsKey(key)) {
+
+                    // TODO: reference
+                    // TODO: o
+
+                    writeProperties.get(key).accept(value);
+                    if (removeParameter) {
+                        properties.remove(key);
+                        rc = true;
+                    }
+                }
+            };
+        }
+
         // must set reference parameters first before the other bindings
         int size = properties.size();
         setReferenceProperties(camelContext, target, properties);
-        rc = properties.size() != size;
+        rc |= properties.size() != size;
 
         String uOptionPrefix = "";
         if (ignoreCase && isNotEmpty(optionPrefix)) {
@@ -471,7 +506,7 @@ public final class PropertyBindingSupport {
                 iter.remove();
                 rc = true;
             }
-            if (madatory && !bound) {
+            if (mandatory && !bound) {
                 throw new PropertyBindingException(target, key, value);
             }
         }
diff --git a/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/LogEndpointTest.java b/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/LogEndpointTest.java
new file mode 100644
index 0000000..eb2174f
--- /dev/null
+++ b/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/LogEndpointTest.java
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.itest.jmh;
+
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.junit.Test;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.Level;
+import org.openjdk.jmh.annotations.Measurement;
+import org.openjdk.jmh.annotations.Mode;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.annotations.TearDown;
+import org.openjdk.jmh.infra.Blackhole;
+import org.openjdk.jmh.runner.Runner;
+import org.openjdk.jmh.runner.options.Options;
+import org.openjdk.jmh.runner.options.OptionsBuilder;
+import org.openjdk.jmh.runner.options.TimeValue;
+
+/**
+ * Tests fast property binding on endpoints
+ */
+public class LogEndpointTest {
+
+    @Test
+    public void launchBenchmark() throws Exception {
+        Options opt = new OptionsBuilder()
+            // Specify which benchmarks to run.
+            // You can be more specific if you'd like to run only one benchmark per test.
+            .include(this.getClass().getName() + ".*")
+            // Set the following options as needed
+            .mode(Mode.All)
+            .timeUnit(TimeUnit.MICROSECONDS)
+            .warmupTime(TimeValue.seconds(1))
+            .warmupIterations(2)
+            .measurementTime(TimeValue.seconds(1))
+            .measurementIterations(2)
+            .threads(2)
+            .forks(1)
+            .shouldFailOnError(true)
+            .shouldDoGC(true)
+            .build();
+
+        new Runner(opt).run();
+    }
+
+    // The JMH samples are the best documentation for how to use it
+    // http://hg.openjdk.java.net/code-tools/jmh/file/tip/jmh-samples/src/main/java/org/openjdk/jmh/samples/
+    @State(Scope.Thread)
+    public static class BenchmarkState {
+        CamelContext camel;
+        AtomicInteger counter;
+
+        @Setup(Level.Trial)
+        public void initialize() {
+            camel = new DefaultCamelContext();
+            camel.getGlobalOptions().put(Exchange.MAXIMUM_ENDPOINT_CACHE_SIZE, "0");
+            counter = new AtomicInteger();
+        }
+
+        @TearDown(Level.Trial)
+        public void close() {
+            try {
+                camel.stop();
+            } catch (Exception e) {
+                // ignore
+            }
+        }
+
+    }
+
+    @Benchmark
+    @Measurement(batchSize = 1000)
+    public void logEndpoint(BenchmarkState state, Blackhole bh) {
+        // use the legacy binding which uses reflection
+        // Endpoint out = state.camel.getEndpoint("log:foo?basicPropertyBinding=true&groupSize=" + state.counter.incrementAndGet());
+        Endpoint out = state.camel.getEndpoint("log:foo?groupSize=" + state.counter.incrementAndGet());
+        bh.consume(out);
+    }
+
+}
diff --git a/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/SimpleMockPlaceholderTest.java b/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/SimpleMockPlaceholderTest.java
new file mode 100644
index 0000000..fb43d65
--- /dev/null
+++ b/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/SimpleMockPlaceholderTest.java
@@ -0,0 +1,117 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.itest.jmh;
+
+import java.util.Properties;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.junit.Test;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.Level;
+import org.openjdk.jmh.annotations.Measurement;
+import org.openjdk.jmh.annotations.Mode;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.annotations.TearDown;
+import org.openjdk.jmh.infra.Blackhole;
+import org.openjdk.jmh.runner.Runner;
+import org.openjdk.jmh.runner.options.Options;
+import org.openjdk.jmh.runner.options.OptionsBuilder;
+import org.openjdk.jmh.runner.options.TimeValue;
+
+/**
+ * Tests a simple Camel route
+ */
+public class SimpleMockPlaceholderTest {
+
+    @Test
+    public void launchBenchmark() throws Exception {
+        Options opt = new OptionsBuilder()
+            // Specify which benchmarks to run.
+            // You can be more specific if you'd like to run only one benchmark per test.
+            .include(this.getClass().getName() + ".*")
+            // Set the following options as needed
+            .mode(Mode.All)
+            .timeUnit(TimeUnit.MICROSECONDS)
+            .warmupTime(TimeValue.seconds(1))
+            .warmupIterations(2)
+            .measurementTime(TimeValue.seconds(1))
+            .measurementIterations(2)
+            .threads(2)
+            .forks(1)
+            .shouldFailOnError(true)
+            .shouldDoGC(true)
+            .build();
+
+        new Runner(opt).run();
+    }
+
+    // The JMH samples are the best documentation for how to use it
+    // http://hg.openjdk.java.net/code-tools/jmh/file/tip/jmh-samples/src/main/java/org/openjdk/jmh/samples/
+    @State(Scope.Thread)
+    public static class BenchmarkState {
+        CamelContext camel;
+        ProducerTemplate producer;
+
+        @Setup(Level.Trial)
+        public void initialize() {
+            camel = new DefaultCamelContext();
+
+            Properties prop = new Properties();
+            prop.put("foolish", "log:foo?groupSize=10");
+            prop.put("mymock", "mock:result?retainFirst=0");
+            camel.getPropertiesComponent().setInitialProperties(prop);
+
+            try {
+                camel.addRoutes(new RouteBuilder() {
+                    @Override
+                    public void configure() throws Exception {
+                        from("direct:start").to("{{foolish}}").to("log:bar").to("{{mymock}}");
+                    }
+                });
+                camel.start();
+                producer = camel.createProducerTemplate();
+            } catch (Exception e) {
+                // ignore
+            }
+        }
+
+        @TearDown(Level.Trial)
+        public void close() {
+            try {
+                producer.stop();
+                camel.stop();
+            } catch (Exception e) {
+                // ignore
+            }
+        }
+
+    }
+
+    @Benchmark
+    @Measurement(batchSize = 1000)
+    public void simpleMockPlaceholderTest(BenchmarkState state, Blackhole bh) {
+        ProducerTemplate template = state.producer;
+        template.sendBody("direct:start", "Hello World");
+    }
+
+}
diff --git a/tests/camel-jmh/src/test/resources/log4j2.properties b/tests/camel-jmh/src/test/resources/log4j2.properties
index 6116fc7..2ae0380 100644
--- a/tests/camel-jmh/src/test/resources/log4j2.properties
+++ b/tests/camel-jmh/src/test/resources/log4j2.properties
@@ -17,7 +17,7 @@
 
 appender.file.type = File
 appender.file.name = file
-appender.file.fileName = target/camel-itest-test.log
+appender.file.fileName = target/camel-jmh-test.log
 appender.file.layout.type = PatternLayout
 appender.file.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
 appender.stdout.type = Console