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:29 UTC

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

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;
         }