You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2023/01/11 14:02:32 UTC

[camel] 02/03: CAMEL-18877 - camel-caffeine - Key should be string type

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

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

commit ca41e29731f5d0bd35a2fb576e959f6efd644728
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Jan 11 14:57:50 2023 +0100

    CAMEL-18877 - camel-caffeine - Key should be string type
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../caffeine/cache/CaffeineCacheComponentConfigurer.java       | 10 ++--------
 .../caffeine/cache/CaffeineCacheEndpointConfigurer.java        | 10 ++--------
 .../caffeine/cache/CaffeineCacheEndpointUriFactory.java        |  3 +--
 .../caffeine/load/CaffeineLoadCacheComponentConfigurer.java    | 10 ++--------
 .../caffeine/load/CaffeineLoadCacheEndpointConfigurer.java     | 10 ++--------
 .../caffeine/load/CaffeineLoadCacheEndpointUriFactory.java     |  3 +--
 .../apache/camel/component/caffeine/cache/caffeine-cache.json  |  6 ++----
 .../camel/component/caffeine/load/caffeine-loadcache.json      |  6 ++----
 .../caffeine/loadcache/CaffeineLoadCacheProducerTest.java      |  6 +++---
 .../caffeine/loadcache/CaffeineLoadCacheTestSupport.java       |  6 +++---
 10 files changed, 20 insertions(+), 50 deletions(-)

diff --git a/components/camel-caffeine/src/generated/java/org/apache/camel/component/caffeine/cache/CaffeineCacheComponentConfigurer.java b/components/camel-caffeine/src/generated/java/org/apache/camel/component/caffeine/cache/CaffeineCacheComponentConfigurer.java
index 0cd5267a378..25eb87d55fd 100644
--- a/components/camel-caffeine/src/generated/java/org/apache/camel/component/caffeine/cache/CaffeineCacheComponentConfigurer.java
+++ b/components/camel-caffeine/src/generated/java/org/apache/camel/component/caffeine/cache/CaffeineCacheComponentConfigurer.java
@@ -44,9 +44,7 @@ public class CaffeineCacheComponentConfigurer extends PropertyConfigurerSupport
         case "expireAfterWriteTime": getOrCreateConfiguration(target).setExpireAfterWriteTime(property(camelContext, int.class, value)); return true;
         case "initialcapacity":
         case "initialCapacity": getOrCreateConfiguration(target).setInitialCapacity(property(camelContext, java.lang.Integer.class, value)); return true;
-        case "key": getOrCreateConfiguration(target).setKey(property(camelContext, java.lang.Object.class, value)); return true;
-        case "keytype":
-        case "keyType": getOrCreateConfiguration(target).setKeyType(property(camelContext, java.lang.String.class, value)); return true;
+        case "key": getOrCreateConfiguration(target).setKey(property(camelContext, java.lang.String.class, value)); return true;
         case "lazystartproducer":
         case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
         case "maximumsize":
@@ -82,9 +80,7 @@ public class CaffeineCacheComponentConfigurer extends PropertyConfigurerSupport
         case "expireAfterWriteTime": return int.class;
         case "initialcapacity":
         case "initialCapacity": return java.lang.Integer.class;
-        case "key": return java.lang.Object.class;
-        case "keytype":
-        case "keyType": return java.lang.String.class;
+        case "key": return java.lang.String.class;
         case "lazystartproducer":
         case "lazyStartProducer": return boolean.class;
         case "maximumsize":
@@ -122,8 +118,6 @@ public class CaffeineCacheComponentConfigurer extends PropertyConfigurerSupport
         case "initialcapacity":
         case "initialCapacity": return getOrCreateConfiguration(target).getInitialCapacity();
         case "key": return getOrCreateConfiguration(target).getKey();
-        case "keytype":
-        case "keyType": return getOrCreateConfiguration(target).getKeyType();
         case "lazystartproducer":
         case "lazyStartProducer": return target.isLazyStartProducer();
         case "maximumsize":
diff --git a/components/camel-caffeine/src/generated/java/org/apache/camel/component/caffeine/cache/CaffeineCacheEndpointConfigurer.java b/components/camel-caffeine/src/generated/java/org/apache/camel/component/caffeine/cache/CaffeineCacheEndpointConfigurer.java
index d902545ccc8..c2b65a7f97c 100644
--- a/components/camel-caffeine/src/generated/java/org/apache/camel/component/caffeine/cache/CaffeineCacheEndpointConfigurer.java
+++ b/components/camel-caffeine/src/generated/java/org/apache/camel/component/caffeine/cache/CaffeineCacheEndpointConfigurer.java
@@ -34,9 +34,7 @@ public class CaffeineCacheEndpointConfigurer extends PropertyConfigurerSupport i
         case "expireAfterWriteTime": target.getConfiguration().setExpireAfterWriteTime(property(camelContext, int.class, value)); return true;
         case "initialcapacity":
         case "initialCapacity": target.getConfiguration().setInitialCapacity(property(camelContext, java.lang.Integer.class, value)); return true;
-        case "key": target.getConfiguration().setKey(property(camelContext, java.lang.Object.class, value)); return true;
-        case "keytype":
-        case "keyType": target.getConfiguration().setKeyType(property(camelContext, java.lang.String.class, value)); return true;
+        case "key": target.getConfiguration().setKey(property(camelContext, java.lang.String.class, value)); return true;
         case "lazystartproducer":
         case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
         case "maximumsize":
@@ -69,9 +67,7 @@ public class CaffeineCacheEndpointConfigurer extends PropertyConfigurerSupport i
         case "expireAfterWriteTime": return int.class;
         case "initialcapacity":
         case "initialCapacity": return java.lang.Integer.class;
-        case "key": return java.lang.Object.class;
-        case "keytype":
-        case "keyType": return java.lang.String.class;
+        case "key": return java.lang.String.class;
         case "lazystartproducer":
         case "lazyStartProducer": return boolean.class;
         case "maximumsize":
@@ -106,8 +102,6 @@ public class CaffeineCacheEndpointConfigurer extends PropertyConfigurerSupport i
         case "initialcapacity":
         case "initialCapacity": return target.getConfiguration().getInitialCapacity();
         case "key": return target.getConfiguration().getKey();
-        case "keytype":
-        case "keyType": return target.getConfiguration().getKeyType();
         case "lazystartproducer":
         case "lazyStartProducer": return target.isLazyStartProducer();
         case "maximumsize":
diff --git a/components/camel-caffeine/src/generated/java/org/apache/camel/component/caffeine/cache/CaffeineCacheEndpointUriFactory.java b/components/camel-caffeine/src/generated/java/org/apache/camel/component/caffeine/cache/CaffeineCacheEndpointUriFactory.java
index fb9c8a1ae30..49c4bde7d5d 100644
--- a/components/camel-caffeine/src/generated/java/org/apache/camel/component/caffeine/cache/CaffeineCacheEndpointUriFactory.java
+++ b/components/camel-caffeine/src/generated/java/org/apache/camel/component/caffeine/cache/CaffeineCacheEndpointUriFactory.java
@@ -21,7 +21,7 @@ public class CaffeineCacheEndpointUriFactory extends org.apache.camel.support.co
     private static final Set<String> SECRET_PROPERTY_NAMES;
     private static final Set<String> MULTI_VALUE_PREFIXES;
     static {
-        Set<String> props = new HashSet<>(16);
+        Set<String> props = new HashSet<>(15);
         props.add("action");
         props.add("cacheLoader");
         props.add("cacheName");
@@ -31,7 +31,6 @@ public class CaffeineCacheEndpointUriFactory extends org.apache.camel.support.co
         props.add("expireAfterWriteTime");
         props.add("initialCapacity");
         props.add("key");
-        props.add("keyType");
         props.add("lazyStartProducer");
         props.add("maximumSize");
         props.add("removalListener");
diff --git a/components/camel-caffeine/src/generated/java/org/apache/camel/component/caffeine/load/CaffeineLoadCacheComponentConfigurer.java b/components/camel-caffeine/src/generated/java/org/apache/camel/component/caffeine/load/CaffeineLoadCacheComponentConfigurer.java
index b8f641206b1..1904727074d 100644
--- a/components/camel-caffeine/src/generated/java/org/apache/camel/component/caffeine/load/CaffeineLoadCacheComponentConfigurer.java
+++ b/components/camel-caffeine/src/generated/java/org/apache/camel/component/caffeine/load/CaffeineLoadCacheComponentConfigurer.java
@@ -44,9 +44,7 @@ public class CaffeineLoadCacheComponentConfigurer extends PropertyConfigurerSupp
         case "expireAfterWriteTime": getOrCreateConfiguration(target).setExpireAfterWriteTime(property(camelContext, int.class, value)); return true;
         case "initialcapacity":
         case "initialCapacity": getOrCreateConfiguration(target).setInitialCapacity(property(camelContext, java.lang.Integer.class, value)); return true;
-        case "key": getOrCreateConfiguration(target).setKey(property(camelContext, java.lang.Object.class, value)); return true;
-        case "keytype":
-        case "keyType": getOrCreateConfiguration(target).setKeyType(property(camelContext, java.lang.String.class, value)); return true;
+        case "key": getOrCreateConfiguration(target).setKey(property(camelContext, java.lang.String.class, value)); return true;
         case "lazystartproducer":
         case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
         case "maximumsize":
@@ -82,9 +80,7 @@ public class CaffeineLoadCacheComponentConfigurer extends PropertyConfigurerSupp
         case "expireAfterWriteTime": return int.class;
         case "initialcapacity":
         case "initialCapacity": return java.lang.Integer.class;
-        case "key": return java.lang.Object.class;
-        case "keytype":
-        case "keyType": return java.lang.String.class;
+        case "key": return java.lang.String.class;
         case "lazystartproducer":
         case "lazyStartProducer": return boolean.class;
         case "maximumsize":
@@ -122,8 +118,6 @@ public class CaffeineLoadCacheComponentConfigurer extends PropertyConfigurerSupp
         case "initialcapacity":
         case "initialCapacity": return getOrCreateConfiguration(target).getInitialCapacity();
         case "key": return getOrCreateConfiguration(target).getKey();
-        case "keytype":
-        case "keyType": return getOrCreateConfiguration(target).getKeyType();
         case "lazystartproducer":
         case "lazyStartProducer": return target.isLazyStartProducer();
         case "maximumsize":
diff --git a/components/camel-caffeine/src/generated/java/org/apache/camel/component/caffeine/load/CaffeineLoadCacheEndpointConfigurer.java b/components/camel-caffeine/src/generated/java/org/apache/camel/component/caffeine/load/CaffeineLoadCacheEndpointConfigurer.java
index 2031c350dfc..df5d77dcace 100644
--- a/components/camel-caffeine/src/generated/java/org/apache/camel/component/caffeine/load/CaffeineLoadCacheEndpointConfigurer.java
+++ b/components/camel-caffeine/src/generated/java/org/apache/camel/component/caffeine/load/CaffeineLoadCacheEndpointConfigurer.java
@@ -34,9 +34,7 @@ public class CaffeineLoadCacheEndpointConfigurer extends PropertyConfigurerSuppo
         case "expireAfterWriteTime": target.getConfiguration().setExpireAfterWriteTime(property(camelContext, int.class, value)); return true;
         case "initialcapacity":
         case "initialCapacity": target.getConfiguration().setInitialCapacity(property(camelContext, java.lang.Integer.class, value)); return true;
-        case "key": target.getConfiguration().setKey(property(camelContext, java.lang.Object.class, value)); return true;
-        case "keytype":
-        case "keyType": target.getConfiguration().setKeyType(property(camelContext, java.lang.String.class, value)); return true;
+        case "key": target.getConfiguration().setKey(property(camelContext, java.lang.String.class, value)); return true;
         case "lazystartproducer":
         case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
         case "maximumsize":
@@ -69,9 +67,7 @@ public class CaffeineLoadCacheEndpointConfigurer extends PropertyConfigurerSuppo
         case "expireAfterWriteTime": return int.class;
         case "initialcapacity":
         case "initialCapacity": return java.lang.Integer.class;
-        case "key": return java.lang.Object.class;
-        case "keytype":
-        case "keyType": return java.lang.String.class;
+        case "key": return java.lang.String.class;
         case "lazystartproducer":
         case "lazyStartProducer": return boolean.class;
         case "maximumsize":
@@ -106,8 +102,6 @@ public class CaffeineLoadCacheEndpointConfigurer extends PropertyConfigurerSuppo
         case "initialcapacity":
         case "initialCapacity": return target.getConfiguration().getInitialCapacity();
         case "key": return target.getConfiguration().getKey();
-        case "keytype":
-        case "keyType": return target.getConfiguration().getKeyType();
         case "lazystartproducer":
         case "lazyStartProducer": return target.isLazyStartProducer();
         case "maximumsize":
diff --git a/components/camel-caffeine/src/generated/java/org/apache/camel/component/caffeine/load/CaffeineLoadCacheEndpointUriFactory.java b/components/camel-caffeine/src/generated/java/org/apache/camel/component/caffeine/load/CaffeineLoadCacheEndpointUriFactory.java
index 12b720c4383..14b1a3270ce 100644
--- a/components/camel-caffeine/src/generated/java/org/apache/camel/component/caffeine/load/CaffeineLoadCacheEndpointUriFactory.java
+++ b/components/camel-caffeine/src/generated/java/org/apache/camel/component/caffeine/load/CaffeineLoadCacheEndpointUriFactory.java
@@ -21,7 +21,7 @@ public class CaffeineLoadCacheEndpointUriFactory extends org.apache.camel.suppor
     private static final Set<String> SECRET_PROPERTY_NAMES;
     private static final Set<String> MULTI_VALUE_PREFIXES;
     static {
-        Set<String> props = new HashSet<>(16);
+        Set<String> props = new HashSet<>(15);
         props.add("action");
         props.add("cacheLoader");
         props.add("cacheName");
@@ -31,7 +31,6 @@ public class CaffeineLoadCacheEndpointUriFactory extends org.apache.camel.suppor
         props.add("expireAfterWriteTime");
         props.add("initialCapacity");
         props.add("key");
-        props.add("keyType");
         props.add("lazyStartProducer");
         props.add("maximumSize");
         props.add("removalListener");
diff --git a/components/camel-caffeine/src/generated/resources/org/apache/camel/component/caffeine/cache/caffeine-cache.json b/components/camel-caffeine/src/generated/resources/org/apache/camel/component/caffeine/cache/caffeine-cache.json
index 4cd72d45576..345db6d8d60 100644
--- a/components/camel-caffeine/src/generated/resources/org/apache/camel/component/caffeine/cache/caffeine-cache.json
+++ b/components/camel-caffeine/src/generated/resources/org/apache/camel/component/caffeine/cache/caffeine-cache.json
@@ -28,13 +28,12 @@
     "expireAfterAccessTime": { "kind": "property", "displayName": "Expire After Access Time", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 300, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "Specifies that each entry should be automatically removed from the cache once a fixed dura [...]
     "expireAfterWriteTime": { "kind": "property", "displayName": "Expire After Write Time", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 300, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "Specifies that each entry should be automatically removed from the cache once a fixed durati [...]
     "initialCapacity": { "kind": "property", "displayName": "Initial Capacity", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "Sets the minimum total size for the internal data structures. Providing a large enough estimate at construction [...]
-    "key": { "kind": "property", "displayName": "Key", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "To configure the default action key. If a key is set in the message header, then the key from the header takes precedence." },
+    "key": { "kind": "property", "displayName": "Key", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "To configure the default action key. If a key is set in the message header, then the key from the header takes precedence." },
     "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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 star [...]
     "maximumSize": { "kind": "property", "displayName": "Maximum Size", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "Specifies the maximum number of entries the cache may contain. Note that the cache may evict an entry before this limit [...]
     "autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
     "cacheLoader": { "kind": "property", "displayName": "Cache Loader", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.github.benmanes.caffeine.cache.CacheLoader", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "To configure a CacheLoader in case of a LoadCache use" },
     "configuration": { "kind": "property", "displayName": "Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.caffeine.CaffeineConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the global component configuration" },
-    "keyType": { "kind": "property", "displayName": "Key Type", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "The cache key type, default java.lang.Object" },
     "removalListener": { "kind": "property", "displayName": "Removal Listener", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.github.benmanes.caffeine.cache.RemovalListener", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "Set a specific removal Listener for the cache" },
     "statsCounter": { "kind": "property", "displayName": "Stats Counter", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.github.benmanes.caffeine.cache.stats.StatsCounter", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "Set a specific Stats Counter for the cache stats" },
     "statsEnabled": { "kind": "property", "displayName": "Stats Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "To enable stats on the cache" },
@@ -57,11 +56,10 @@
     "expireAfterAccessTime": { "kind": "parameter", "displayName": "Expire After Access Time", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 300, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "Specifies that each entry should be automatically removed from the cache once a fixed dur [...]
     "expireAfterWriteTime": { "kind": "parameter", "displayName": "Expire After Write Time", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 300, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "Specifies that each entry should be automatically removed from the cache once a fixed durat [...]
     "initialCapacity": { "kind": "parameter", "displayName": "Initial Capacity", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "Sets the minimum total size for the internal data structures. Providing a large enough estimate at constructio [...]
-    "key": { "kind": "parameter", "displayName": "Key", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "To configure the default action key. If a key is set in the message header, then the key from the header takes precedence." },
+    "key": { "kind": "parameter", "displayName": "Key", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "To configure the default action key. If a key is set in the message header, then the key from the header takes precedence." },
     "maximumSize": { "kind": "parameter", "displayName": "Maximum Size", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "Specifies the maximum number of entries the cache may contain. Note that the cache may evict an entry before this limi [...]
     "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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 other [...]
     "cacheLoader": { "kind": "parameter", "displayName": "Cache Loader", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.github.benmanes.caffeine.cache.CacheLoader", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "To configure a CacheLoader in case of a LoadCache use" },
-    "keyType": { "kind": "parameter", "displayName": "Key Type", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "The cache key type, default java.lang.Object" },
     "removalListener": { "kind": "parameter", "displayName": "Removal Listener", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.github.benmanes.caffeine.cache.RemovalListener", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "Set a specific removal Listener for the cache" },
     "statsCounter": { "kind": "parameter", "displayName": "Stats Counter", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.github.benmanes.caffeine.cache.stats.StatsCounter", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "Set a specific Stats Counter for the cache stats" },
     "statsEnabled": { "kind": "parameter", "displayName": "Stats Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "To enable stats on the cache" },
diff --git a/components/camel-caffeine/src/generated/resources/org/apache/camel/component/caffeine/load/caffeine-loadcache.json b/components/camel-caffeine/src/generated/resources/org/apache/camel/component/caffeine/load/caffeine-loadcache.json
index 7ea134c4ca7..92a9687241d 100644
--- a/components/camel-caffeine/src/generated/resources/org/apache/camel/component/caffeine/load/caffeine-loadcache.json
+++ b/components/camel-caffeine/src/generated/resources/org/apache/camel/component/caffeine/load/caffeine-loadcache.json
@@ -28,13 +28,12 @@
     "expireAfterAccessTime": { "kind": "property", "displayName": "Expire After Access Time", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 300, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "Specifies that each entry should be automatically removed from the cache once a fixed dura [...]
     "expireAfterWriteTime": { "kind": "property", "displayName": "Expire After Write Time", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 300, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "Specifies that each entry should be automatically removed from the cache once a fixed durati [...]
     "initialCapacity": { "kind": "property", "displayName": "Initial Capacity", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "Sets the minimum total size for the internal data structures. Providing a large enough estimate at construction [...]
-    "key": { "kind": "property", "displayName": "Key", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "To configure the default action key. If a key is set in the message header, then the key from the header takes precedence." },
+    "key": { "kind": "property", "displayName": "Key", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "To configure the default action key. If a key is set in the message header, then the key from the header takes precedence." },
     "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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 star [...]
     "maximumSize": { "kind": "property", "displayName": "Maximum Size", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "Specifies the maximum number of entries the cache may contain. Note that the cache may evict an entry before this limit [...]
     "autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
     "cacheLoader": { "kind": "property", "displayName": "Cache Loader", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.github.benmanes.caffeine.cache.CacheLoader", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "To configure a CacheLoader in case of a LoadCache use" },
     "configuration": { "kind": "property", "displayName": "Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.caffeine.CaffeineConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the global component configuration" },
-    "keyType": { "kind": "property", "displayName": "Key Type", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "The cache key type, default java.lang.Object" },
     "removalListener": { "kind": "property", "displayName": "Removal Listener", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.github.benmanes.caffeine.cache.RemovalListener", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "Set a specific removal Listener for the cache" },
     "statsCounter": { "kind": "property", "displayName": "Stats Counter", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.github.benmanes.caffeine.cache.stats.StatsCounter", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "Set a specific Stats Counter for the cache stats" },
     "statsEnabled": { "kind": "property", "displayName": "Stats Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "To enable stats on the cache" },
@@ -57,11 +56,10 @@
     "expireAfterAccessTime": { "kind": "parameter", "displayName": "Expire After Access Time", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 300, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "Specifies that each entry should be automatically removed from the cache once a fixed dur [...]
     "expireAfterWriteTime": { "kind": "parameter", "displayName": "Expire After Write Time", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 300, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "Specifies that each entry should be automatically removed from the cache once a fixed durat [...]
     "initialCapacity": { "kind": "parameter", "displayName": "Initial Capacity", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "Sets the minimum total size for the internal data structures. Providing a large enough estimate at constructio [...]
-    "key": { "kind": "parameter", "displayName": "Key", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "To configure the default action key. If a key is set in the message header, then the key from the header takes precedence." },
+    "key": { "kind": "parameter", "displayName": "Key", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "To configure the default action key. If a key is set in the message header, then the key from the header takes precedence." },
     "maximumSize": { "kind": "parameter", "displayName": "Maximum Size", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "Specifies the maximum number of entries the cache may contain. Note that the cache may evict an entry before this limi [...]
     "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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 other [...]
     "cacheLoader": { "kind": "parameter", "displayName": "Cache Loader", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.github.benmanes.caffeine.cache.CacheLoader", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "To configure a CacheLoader in case of a LoadCache use" },
-    "keyType": { "kind": "parameter", "displayName": "Key Type", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "The cache key type, default java.lang.Object" },
     "removalListener": { "kind": "parameter", "displayName": "Removal Listener", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.github.benmanes.caffeine.cache.RemovalListener", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "Set a specific removal Listener for the cache" },
     "statsCounter": { "kind": "parameter", "displayName": "Stats Counter", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.github.benmanes.caffeine.cache.stats.StatsCounter", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "Set a specific Stats Counter for the cache stats" },
     "statsEnabled": { "kind": "parameter", "displayName": "Stats Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.caffeine.CaffeineConfiguration", "configurationField": "configuration", "description": "To enable stats on the cache" },
diff --git a/components/camel-caffeine/src/test/java/org/apache/camel/component/caffeine/loadcache/CaffeineLoadCacheProducerTest.java b/components/camel-caffeine/src/test/java/org/apache/camel/component/caffeine/loadcache/CaffeineLoadCacheProducerTest.java
index 806c3bf495c..617e81d13c4 100644
--- a/components/camel-caffeine/src/test/java/org/apache/camel/component/caffeine/loadcache/CaffeineLoadCacheProducerTest.java
+++ b/components/camel-caffeine/src/test/java/org/apache/camel/component/caffeine/loadcache/CaffeineLoadCacheProducerTest.java
@@ -60,7 +60,7 @@ public class CaffeineLoadCacheProducerTest extends CaffeineLoadCacheTestSupport
 
     @Test
     void testCachePut() {
-        final int key = 1;
+        final String key = "1";
         final int val = 3;
 
         MockEndpoint mock = getMockEndpoint("mock:result");
@@ -107,7 +107,7 @@ public class CaffeineLoadCacheProducerTest extends CaffeineLoadCacheTestSupport
 
     @Test
     void testCacheGet() throws Exception {
-        final Integer key = 1;
+        final String key = "1";
         final Integer val = 2;
 
         MockEndpoint mock = getMockEndpoint("mock:result");
@@ -157,7 +157,7 @@ public class CaffeineLoadCacheProducerTest extends CaffeineLoadCacheTestSupport
     @Test
     void testCacheInvalidate() throws Exception {
         final Cache<Object, Object> cache = getTestCache();
-        final Integer key = 1;
+        final String key = "1";
         final Integer val = 1;
 
         cache.put(key, val);
diff --git a/components/camel-caffeine/src/test/java/org/apache/camel/component/caffeine/loadcache/CaffeineLoadCacheTestSupport.java b/components/camel-caffeine/src/test/java/org/apache/camel/component/caffeine/loadcache/CaffeineLoadCacheTestSupport.java
index 27fdf1d5368..6eaa313505f 100644
--- a/components/camel-caffeine/src/test/java/org/apache/camel/component/caffeine/loadcache/CaffeineLoadCacheTestSupport.java
+++ b/components/camel-caffeine/src/test/java/org/apache/camel/component/caffeine/loadcache/CaffeineLoadCacheTestSupport.java
@@ -28,11 +28,11 @@ public class CaffeineLoadCacheTestSupport extends CamelTestSupport {
 
     @BindToRegistry("cache")
     public Cache createCache() {
-        CacheLoader cl = new CacheLoader<Integer, Integer>() {
+        CacheLoader cl = new CacheLoader<String, Integer>() {
 
             @Override
-            public Integer load(Integer key) {
-                return key + 1;
+            public Integer load(String key) {
+                return Integer.valueOf(key) + 1;
             }
         };
         return cache = Caffeine.newBuilder().build(cl);