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 2021/12/22 13:39:43 UTC

[camel] branch main updated: CAMEL-17251: camel-spring-xml - Load type converters should be false

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

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


The following commit(s) were added to refs/heads/main by this push:
     new f65d5d3  CAMEL-17251: camel-spring-xml - Load type converters should be false
f65d5d3 is described below

commit f65d5d3c6d8c1c9336e74fc3fd736fc7235f4835
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Dec 22 14:39:12 2021 +0100

    CAMEL-17251: camel-spring-xml - Load type converters should be false
---
 .../resources/org/apache/camel/spring/xml/camelContext.json    |  2 +-
 .../org/apache/camel/spring/xml/CamelContextFactoryBean.java   | 10 ++++------
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/components/camel-spring-xml/src/generated/resources/org/apache/camel/spring/xml/camelContext.json b/components/camel-spring-xml/src/generated/resources/org/apache/camel/spring/xml/camelContext.json
index 69c3078..ac81862 100644
--- a/components/camel-spring-xml/src/generated/resources/org/apache/camel/spring/xml/camelContext.json
+++ b/components/camel-spring-xml/src/generated/resources/org/apache/camel/spring/xml/camelContext.json
@@ -39,7 +39,7 @@
     "threadNamePattern": { "kind": "attribute", "displayName": "Thread Name Pattern", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Camel (#camelId#) thread ##counter# - #name#", "description": "Sets the thread name pattern used for creating the full thread name. The default pattern is: Camel (#camelId#) thread ##counter# - #name# Where #camelId# is the name of the org.apache.camel.CamelCont [...]
     "shutdownRoute": { "kind": "attribute", "displayName": "Shutdown Route", "required": false, "type": "enum", "javaType": "org.apache.camel.ShutdownRoute", "enum": [ "default", "defer" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Default", "description": "Sets the ShutdownRoute option for routes." },
     "shutdownRunningTask": { "kind": "attribute", "displayName": "Shutdown Running Task", "required": false, "type": "enum", "javaType": "org.apache.camel.ShutdownRunningTask", "enum": [ "complete-all-tasks", "complete-current-task-only" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "CompleteCurrentTaskOnly", "description": "Sets the ShutdownRunningTask option to use when shutting down a route." },
-    "loadTypeConverters": { "kind": "attribute", "displayName": "Load Type Converters", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "true", "description": "Sets whether to load custom type converters by scanning classpath. This can be turned off if you are only using Camel components that does not provide type converters which is needed at runtime. In such situations setting this option to  [...]
+    "loadTypeConverters": { "kind": "attribute", "displayName": "Load Type Converters", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "false", "description": "Whether to load custom type converters by scanning classpath. This is used for backwards compatibility with Camel 2.x. Its recommended to migrate to use fast type converter loading by setting Converter(loader = true) on your custom type [...]
     "typeConverterStatisticsEnabled": { "kind": "attribute", "displayName": "Type Converter Statistics Enabled", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets whether or not type converter statistics is enabled. By default the type converter utilization statistics is disabled. Notice: If enabled then there is a slight performance impact under very heavy load. You can enable\/disable the  [...]
     "loadHealthChecks": { "kind": "attribute", "displayName": "Load Health Checks", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "false", "description": "Whether to load custom health checks by scanning classpath." },
     "inflightRepositoryBrowseEnabled": { "kind": "attribute", "displayName": "Inflight Repository Browse Enabled", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets whether the inflight repository should allow browsing each inflight exchange. This is by default disabled as there is a very slight performance overhead when enabled." },
diff --git a/components/camel-spring-xml/src/main/java/org/apache/camel/spring/xml/CamelContextFactoryBean.java b/components/camel-spring-xml/src/main/java/org/apache/camel/spring/xml/CamelContextFactoryBean.java
index cd47887..4bf106f 100644
--- a/components/camel-spring-xml/src/main/java/org/apache/camel/spring/xml/CamelContextFactoryBean.java
+++ b/components/camel-spring-xml/src/main/java/org/apache/camel/spring/xml/CamelContextFactoryBean.java
@@ -176,7 +176,7 @@ public class CamelContextFactoryBean extends AbstractCamelContextFactoryBean<Spr
     @Metadata(defaultValue = "CompleteCurrentTaskOnly")
     private ShutdownRunningTask shutdownRunningTask;
     @XmlAttribute
-    @Metadata(defaultValue = "true")
+    @Metadata(defaultValue = "false")
     private String loadTypeConverters;
     @XmlAttribute
     private String typeConverterStatisticsEnabled;
@@ -1152,11 +1152,9 @@ public class CamelContextFactoryBean extends AbstractCamelContextFactoryBean<Spr
     }
 
     /**
-     * Sets whether to load custom type converters by scanning classpath. This can be turned off if you are only using
-     * Camel components that does not provide type converters which is needed at runtime. In such situations setting
-     * this option to false, can speedup starting Camel.
-     *
-     * @param loadTypeConverters whether to load custom type converters.
+     * Whether to load custom type converters by scanning classpath. This is used for backwards compatibility with Camel
+     * 2.x. Its recommended to migrate to use fast type converter loading by setting @Converter(loader = true) on your
+     * custom type converter classes.
      */
     public void setLoadTypeConverters(String loadTypeConverters) {
         this.loadTypeConverters = loadTypeConverters;