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 2025/07/17 14:51:01 UTC

(camel) 01/01: CAMEL-22250: camel-jackson - Allow to configure stream reader constraints maxStringLength so big payloads can be parsed.

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

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

commit 6940859bda36a058bf255a80ec41190a6fcde500
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Jul 17 16:50:41 2025 +0200

    CAMEL-22250: camel-jackson - Allow to configure stream reader constraints maxStringLength so big payloads can be parsed.
---
 .../apache/camel/catalog/dataformats/jackson.json  |  3 ++-
 .../camel/catalog/dataformats/jacksonXml.json      |  3 ++-
 .../apache/camel/catalog/models/jacksonXml.json    |  3 ++-
 .../org/apache/camel/catalog/models/json.json      |  3 ++-
 .../apache/camel/catalog/schemas/camel-spring.xsd  | 24 +++++++++++++++++++
 .../apache/camel/catalog/schemas/camel-xml-io.xsd  | 24 +++++++++++++++++++
 .../jackson/JacksonDataFormatConfigurer.java       |  2 ++
 .../apache/camel/component/jackson/jackson.json    |  3 ++-
 .../jackson/AbstractJacksonDataFormat.java         |  9 ++++++++
 .../camel/component/jackson/JacksonDataFormat.java | 13 ++++++++++-
 .../jacksonxml/JacksonXMLDataFormatConfigurer.java |  2 ++
 .../camel/component/jacksonxml/jacksonXml.json     |  3 ++-
 .../component/jacksonxml/JacksonXMLDataFormat.java | 22 +++++++++++++++++-
 .../apache/camel/model/dataformat/jacksonXml.json  |  3 ++-
 .../org/apache/camel/model/dataformat/json.json    |  3 ++-
 .../model/dataformat/JacksonXMLDataFormat.java     | 27 ++++++++++++++++++++++
 .../camel/model/dataformat/JsonDataFormat.java     | 27 ++++++++++++++++++++++
 .../dataformat/JacksonXMLDataFormatReifier.java    |  1 +
 .../reifier/dataformat/JsonDataFormatReifier.java  |  1 +
 .../java/org/apache/camel/xml/in/ModelParser.java  |  2 ++
 .../java/org/apache/camel/xml/out/ModelWriter.java |  2 ++
 .../org/apache/camel/yaml/out/ModelWriter.java     |  2 ++
 .../dsl/yaml/deserializers/ModelDeserializers.java | 12 ++++++++++
 .../generated/resources/schema/camelYamlDsl.json   | 10 ++++++++
 24 files changed, 194 insertions(+), 10 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/jackson.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/jackson.json
index fc6f93ac556..997d0bcfbfd 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/jackson.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/jackson.json
@@ -37,6 +37,7 @@
     "schemaResolver": { "index": 18, "kind": "attribute", "displayName": "Schema Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.jackson.SchemaResolver", "deprecated": false, "autowired": false, "secret": false, "description": "Optional schema resolver used to lookup schemas for the data in transit." },
     "autoDiscoverSchemaResolver": { "index": 19, "kind": "attribute", "displayName": "Auto Discover Schema Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "When not disabled, the SchemaResolver will be looked up into the registry" },
     "namingStrategy": { "index": 20, "kind": "attribute", "displayName": "Naming Strategy", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the the defined Property Naming Strategy.Possible values are: LOWER_CAMEL_CASE, LOWER_DOT_CASE, LOWER_CASE, KEBAB_CASE, SNAKE_CASE and UPPER_CAMEL_CASE" },
-    "contentTypeHeader": { "index": 21, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshall [...]
+    "contentTypeHeader": { "index": 21, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshall [...]
+    "maxStringLength": { "index": 22, "kind": "attribute", "displayName": "Max String Length", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "Jackson. Sets the maximum string length (in chars or bytes, depending on input context). The default is 20,000,000. This limit is not exact, the limit is applied when we increase internal buffer sizes and an ex [...]
   }
 }
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/jacksonXml.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/jacksonXml.json
index ed50da3b958..ac70bb987d3 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/jacksonXml.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/jacksonXml.json
@@ -32,6 +32,7 @@
     "moduleRefs": { "index": 13, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." },
     "enableFeatures": { "index": 14, "kind": "attribute", "displayName": "Enable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.Deserializati [...]
     "disableFeatures": { "index": 15, "kind": "attribute", "displayName": "Disable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.Deserializ [...]
-    "contentTypeHeader": { "index": 16, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshall [...]
+    "contentTypeHeader": { "index": 16, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshall [...]
+    "maxStringLength": { "index": 17, "kind": "attribute", "displayName": "Max String Length", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the maximum string length (in chars or bytes, depending on input context). The default is 20,000,000. This limit is not exact, the limit is applied when we increase internal buffer sizes and an exception w [...]
   }
 }
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/jacksonXml.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/jacksonXml.json
index 0f22728a934..aad0a878dcc 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/jacksonXml.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/jacksonXml.json
@@ -29,6 +29,7 @@
     "moduleRefs": { "index": 13, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." },
     "enableFeatures": { "index": 14, "kind": "attribute", "displayName": "Enable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.Deserializati [...]
     "disableFeatures": { "index": 15, "kind": "attribute", "displayName": "Disable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.Deserializ [...]
-    "contentTypeHeader": { "index": 16, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshall [...]
+    "contentTypeHeader": { "index": 16, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshall [...]
+    "maxStringLength": { "index": 17, "kind": "attribute", "displayName": "Max String Length", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the maximum string length (in chars or bytes, depending on input context). The default is 20,000,000. This limit is not exact, the limit is applied when we increase internal buffer sizes and an exception w [...]
   }
 }
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/json.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/json.json
index 22e3b7ff969..eb0398f656f 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/json.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/json.json
@@ -35,6 +35,7 @@
     "autoDiscoverSchemaResolver": { "index": 20, "kind": "attribute", "displayName": "Auto Discover Schema Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "When not disabled, the SchemaResolver will be looked up into the registry" },
     "namingStrategy": { "index": 21, "kind": "attribute", "displayName": "Naming Strategy", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the the defined Property Naming Strategy.Possible values are: LOWER_CAMEL_CASE, LOWER_DOT_CASE, LOWER_CASE, KEBAB_CASE, SNAKE_CASE and UPPER_CAMEL_CASE" },
     "contentTypeHeader": { "index": 22, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshall [...]
-    "dateFormatPattern": { "index": 23, "kind": "attribute", "displayName": "Date Format Pattern", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To configure the date format while marshall or unmarshall Date fields in JSON using Gson" }
+    "dateFormatPattern": { "index": 23, "kind": "attribute", "displayName": "Date Format Pattern", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To configure the date format while marshall or unmarshall Date fields in JSON using Gson" },
+    "maxStringLength": { "index": 24, "kind": "attribute", "displayName": "Max String Length", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "Jackson. Sets the maximum string length (in chars or bytes, depending on input context). The default is 20,000,000. This limit is not exact, the limit is applied when we increase internal buffer sizes and an ex [...]
   }
 }
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd
index ca682973af6..a4e34965759 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd
@@ -9156,6 +9156,18 @@ can be separated by comma.
 Whether the data format should set the Content-Type header with the type from the data format. For example
 application/xml for data formats marshalling to XML, or application/json for data formats marshalling to JSON. Default
 value: true
+]]>
+            </xs:documentation>
+          </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="maxStringLength" type="xs:string">
+          <xs:annotation>
+            <xs:documentation xml:lang="en">
+<![CDATA[
+Sets the maximum string length (in chars or bytes, depending on input context). The default is 20,000,000. This limit is
+not exact, the limit is applied when we increase internal buffer sizes and an exception will happen at sizes greater
+than this limit. Some text values that are a little bigger than the limit may be treated as valid but no text values
+with sizes less than or equal to this limit will be treated as invalid.
 ]]>
             </xs:documentation>
           </xs:annotation>
@@ -9591,6 +9603,18 @@ value: true
             <xs:documentation xml:lang="en">
 <![CDATA[
 To configure the date format while marshall or unmarshall Date fields in JSON using Gson.
+]]>
+            </xs:documentation>
+          </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="maxStringLength" type="xs:string">
+          <xs:annotation>
+            <xs:documentation xml:lang="en">
+<![CDATA[
+Jackson. Sets the maximum string length (in chars or bytes, depending on input context). The default is 20,000,000. This
+limit is not exact, the limit is applied when we increase internal buffer sizes and an exception will happen at sizes
+greater than this limit. Some text values that are a little bigger than the limit may be treated as valid but no text
+values with sizes less than or equal to this limit will be treated as invalid.
 ]]>
             </xs:documentation>
           </xs:annotation>
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-xml-io.xsd b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-xml-io.xsd
index 8dca4d09661..88a0d37a2f1 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-xml-io.xsd
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-xml-io.xsd
@@ -7829,6 +7829,18 @@ can be separated by comma.
 Whether the data format should set the Content-Type header with the type from the data format. For example
 application/xml for data formats marshalling to XML, or application/json for data formats marshalling to JSON. Default
 value: true
+]]>
+            </xs:documentation>
+          </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="maxStringLength" type="xs:string">
+          <xs:annotation>
+            <xs:documentation xml:lang="en">
+<![CDATA[
+Sets the maximum string length (in chars or bytes, depending on input context). The default is 20,000,000. This limit is
+not exact, the limit is applied when we increase internal buffer sizes and an exception will happen at sizes greater
+than this limit. Some text values that are a little bigger than the limit may be treated as valid but no text values
+with sizes less than or equal to this limit will be treated as invalid.
 ]]>
             </xs:documentation>
           </xs:annotation>
@@ -8264,6 +8276,18 @@ value: true
             <xs:documentation xml:lang="en">
 <![CDATA[
 To configure the date format while marshall or unmarshall Date fields in JSON using Gson.
+]]>
+            </xs:documentation>
+          </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="maxStringLength" type="xs:string">
+          <xs:annotation>
+            <xs:documentation xml:lang="en">
+<![CDATA[
+Jackson. Sets the maximum string length (in chars or bytes, depending on input context). The default is 20,000,000. This
+limit is not exact, the limit is applied when we increase internal buffer sizes and an exception will happen at sizes
+greater than this limit. Some text values that are a little bigger than the limit may be treated as valid but no text
+values with sizes less than or equal to this limit will be treated as invalid.
 ]]>
             </xs:documentation>
           </xs:annotation>
diff --git a/components/camel-jackson/src/generated/java/org/apache/camel/component/jackson/JacksonDataFormatConfigurer.java b/components/camel-jackson/src/generated/java/org/apache/camel/component/jackson/JacksonDataFormatConfigurer.java
index 13468664b87..655bb9a4eea 100644
--- a/components/camel-jackson/src/generated/java/org/apache/camel/component/jackson/JacksonDataFormatConfigurer.java
+++ b/components/camel-jackson/src/generated/java/org/apache/camel/component/jackson/JacksonDataFormatConfigurer.java
@@ -60,6 +60,8 @@ public class JacksonDataFormatConfigurer extends PropertyConfigurerSupport imple
         case "autoDiscoverSchemaResolver": dataformat.setAutoDiscoverSchemaResolver(property(camelContext, boolean.class, value)); return true;
         case "namingstrategy":
         case "namingStrategy": dataformat.setNamingStrategy(property(camelContext, java.lang.String.class, value)); return true;
+        case "maxstringlength":
+        case "maxStringLength": dataformat.setMaxStringLength(property(camelContext, int.class, value)); return true;
         default: return false;
         }
     }
diff --git a/components/camel-jackson/src/generated/resources/META-INF/org/apache/camel/component/jackson/jackson.json b/components/camel-jackson/src/generated/resources/META-INF/org/apache/camel/component/jackson/jackson.json
index fc6f93ac556..997d0bcfbfd 100644
--- a/components/camel-jackson/src/generated/resources/META-INF/org/apache/camel/component/jackson/jackson.json
+++ b/components/camel-jackson/src/generated/resources/META-INF/org/apache/camel/component/jackson/jackson.json
@@ -37,6 +37,7 @@
     "schemaResolver": { "index": 18, "kind": "attribute", "displayName": "Schema Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.jackson.SchemaResolver", "deprecated": false, "autowired": false, "secret": false, "description": "Optional schema resolver used to lookup schemas for the data in transit." },
     "autoDiscoverSchemaResolver": { "index": 19, "kind": "attribute", "displayName": "Auto Discover Schema Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "When not disabled, the SchemaResolver will be looked up into the registry" },
     "namingStrategy": { "index": 20, "kind": "attribute", "displayName": "Naming Strategy", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the the defined Property Naming Strategy.Possible values are: LOWER_CAMEL_CASE, LOWER_DOT_CASE, LOWER_CASE, KEBAB_CASE, SNAKE_CASE and UPPER_CAMEL_CASE" },
-    "contentTypeHeader": { "index": 21, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshall [...]
+    "contentTypeHeader": { "index": 21, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshall [...]
+    "maxStringLength": { "index": 22, "kind": "attribute", "displayName": "Max String Length", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "Jackson. Sets the maximum string length (in chars or bytes, depending on input context). The default is 20,000,000. This limit is not exact, the limit is applied when we increase internal buffer sizes and an ex [...]
   }
 }
diff --git a/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/AbstractJacksonDataFormat.java b/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/AbstractJacksonDataFormat.java
index 39567ec4f87..499cbe3ee77 100644
--- a/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/AbstractJacksonDataFormat.java
+++ b/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/AbstractJacksonDataFormat.java
@@ -91,6 +91,7 @@ public abstract class AbstractJacksonDataFormat extends ServiceSupport
     private SchemaResolver schemaResolver;
     private boolean autoDiscoverSchemaResolver = true;
     private String namingStrategy;
+    private int maxStringLength;
 
     /**
      * Use the default Jackson {@link ObjectMapper} and {@link Object}
@@ -342,6 +343,14 @@ public abstract class AbstractJacksonDataFormat extends ServiceSupport
         this.namingStrategy = namingStrategy;
     }
 
+    public int getMaxStringLength() {
+        return maxStringLength;
+    }
+
+    public void setMaxStringLength(int maxStringLength) {
+        this.maxStringLength = maxStringLength;
+    }
+
     /**
      * To use custom Jackson {@link Module}s
      */
diff --git a/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/JacksonDataFormat.java b/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/JacksonDataFormat.java
index 171066b3f36..20cd860cbf7 100644
--- a/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/JacksonDataFormat.java
+++ b/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/JacksonDataFormat.java
@@ -16,9 +16,12 @@
  */
 package org.apache.camel.component.jackson;
 
+import com.fasterxml.jackson.core.StreamReadConstraints;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.annotations.Dataformat;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Marshal POJOs to JSON and back using Jackson.
@@ -27,6 +30,8 @@ import org.apache.camel.spi.annotations.Dataformat;
 @Metadata(excludeProperties = "library,permissions,dateFormatPattern")
 public class JacksonDataFormat extends AbstractJacksonDataFormat {
 
+    private static final Logger LOG = LoggerFactory.getLogger(JacksonDataFormat.class);
+
     /**
      * Use the default Jackson {@link ObjectMapper} and {@link Object}
      */
@@ -80,7 +85,13 @@ public class JacksonDataFormat extends AbstractJacksonDataFormat {
 
     @Override
     protected ObjectMapper createNewObjectMapper() {
-        return new ObjectMapper();
+        ObjectMapper om = new ObjectMapper();
+        int len = getMaxStringLength();
+        if (len > 0) {
+            LOG.debug("Creating ObjectMapper with maxStringLength: {}", len);
+            om.getFactory().setStreamReadConstraints(StreamReadConstraints.builder().maxStringLength(len).build());
+        }
+        return om;
     }
 
     @Override
diff --git a/components/camel-jacksonxml/src/generated/java/org/apache/camel/component/jacksonxml/JacksonXMLDataFormatConfigurer.java b/components/camel-jacksonxml/src/generated/java/org/apache/camel/component/jacksonxml/JacksonXMLDataFormatConfigurer.java
index f9c8d7bcf37..6b5ec1d09cb 100644
--- a/components/camel-jacksonxml/src/generated/java/org/apache/camel/component/jacksonxml/JacksonXMLDataFormatConfigurer.java
+++ b/components/camel-jacksonxml/src/generated/java/org/apache/camel/component/jacksonxml/JacksonXMLDataFormatConfigurer.java
@@ -50,6 +50,8 @@ public class JacksonXMLDataFormatConfigurer extends PropertyConfigurerSupport im
         case "contenttypeheader":
         case "contentTypeHeader": dataformat.setContentTypeHeader(property(camelContext, boolean.class, value)); return true;
         case "timezone": dataformat.setTimezone(property(camelContext, java.util.TimeZone.class, value)); return true;
+        case "maxstringlength":
+        case "maxStringLength": dataformat.setMaxStringLength(property(camelContext, int.class, value)); return true;
         default: return false;
         }
     }
diff --git a/components/camel-jacksonxml/src/generated/resources/META-INF/org/apache/camel/component/jacksonxml/jacksonXml.json b/components/camel-jacksonxml/src/generated/resources/META-INF/org/apache/camel/component/jacksonxml/jacksonXml.json
index ed50da3b958..ac70bb987d3 100644
--- a/components/camel-jacksonxml/src/generated/resources/META-INF/org/apache/camel/component/jacksonxml/jacksonXml.json
+++ b/components/camel-jacksonxml/src/generated/resources/META-INF/org/apache/camel/component/jacksonxml/jacksonXml.json
@@ -32,6 +32,7 @@
     "moduleRefs": { "index": 13, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." },
     "enableFeatures": { "index": 14, "kind": "attribute", "displayName": "Enable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.Deserializati [...]
     "disableFeatures": { "index": 15, "kind": "attribute", "displayName": "Disable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.Deserializ [...]
-    "contentTypeHeader": { "index": 16, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshall [...]
+    "contentTypeHeader": { "index": 16, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshall [...]
+    "maxStringLength": { "index": 17, "kind": "attribute", "displayName": "Max String Length", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the maximum string length (in chars or bytes, depending on input context). The default is 20,000,000. This limit is not exact, the limit is applied when we increase internal buffer sizes and an exception w [...]
   }
 }
diff --git a/components/camel-jacksonxml/src/main/java/org/apache/camel/component/jacksonxml/JacksonXMLDataFormat.java b/components/camel-jacksonxml/src/main/java/org/apache/camel/component/jacksonxml/JacksonXMLDataFormat.java
index e769a4aa328..9b1097c80f9 100644
--- a/components/camel-jacksonxml/src/main/java/org/apache/camel/component/jacksonxml/JacksonXMLDataFormat.java
+++ b/components/camel-jacksonxml/src/main/java/org/apache/camel/component/jacksonxml/JacksonXMLDataFormat.java
@@ -29,6 +29,7 @@ import java.util.Map;
 import java.util.TimeZone;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.core.StreamReadConstraints;
 import com.fasterxml.jackson.databind.DeserializationFeature;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.MapperFeature;
@@ -86,6 +87,7 @@ public class JacksonXMLDataFormat extends ServiceSupport
     private boolean allowUnmarshallType;
     private boolean contentTypeHeader = true;
     private TimeZone timezone;
+    private int maxStringLength;
 
     /**
      * Use the default Jackson {@link XmlMapper} and {@link Map}
@@ -443,6 +445,14 @@ public class JacksonXMLDataFormat extends ServiceSupport
         this.timezone = timezone;
     }
 
+    public int getMaxStringLength() {
+        return maxStringLength;
+    }
+
+    public void setMaxStringLength(int maxStringLength) {
+        this.maxStringLength = maxStringLength;
+    }
+
     public String getEnableFeatures() {
         return enableFeatures;
     }
@@ -531,6 +541,16 @@ public class JacksonXMLDataFormat extends ServiceSupport
         }
     }
 
+    protected XmlMapper createNewXmlMapper() {
+        XmlMapper xm = new XmlMapper();
+        int len = getMaxStringLength();
+        if (len > 0) {
+            LOG.debug("Creating XmlMapper with maxStringLength: {}", len);
+            xm.getFactory().setStreamReadConstraints(StreamReadConstraints.builder().maxStringLength(len).build());
+        }
+        return xm;
+    }
+
     @Override
     protected void doInit() throws Exception {
         if (unmarshalTypeName != null && (unmarshalType == null || unmarshalType == LinkedHashMap.class)) {
@@ -548,7 +568,7 @@ public class JacksonXMLDataFormat extends ServiceSupport
     @Override
     protected void doStart() throws Exception {
         if (xmlMapper == null) {
-            xmlMapper = new XmlMapper();
+            xmlMapper = createNewXmlMapper();
         }
 
         if (enableJaxbAnnotationModule) {
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/jacksonXml.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/jacksonXml.json
index 0f22728a934..aad0a878dcc 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/jacksonXml.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/jacksonXml.json
@@ -29,6 +29,7 @@
     "moduleRefs": { "index": 13, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." },
     "enableFeatures": { "index": 14, "kind": "attribute", "displayName": "Enable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.Deserializati [...]
     "disableFeatures": { "index": 15, "kind": "attribute", "displayName": "Disable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.Deserializ [...]
-    "contentTypeHeader": { "index": 16, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshall [...]
+    "contentTypeHeader": { "index": 16, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshall [...]
+    "maxStringLength": { "index": 17, "kind": "attribute", "displayName": "Max String Length", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the maximum string length (in chars or bytes, depending on input context). The default is 20,000,000. This limit is not exact, the limit is applied when we increase internal buffer sizes and an exception w [...]
   }
 }
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/json.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/json.json
index 22e3b7ff969..eb0398f656f 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/json.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/json.json
@@ -35,6 +35,7 @@
     "autoDiscoverSchemaResolver": { "index": 20, "kind": "attribute", "displayName": "Auto Discover Schema Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "When not disabled, the SchemaResolver will be looked up into the registry" },
     "namingStrategy": { "index": 21, "kind": "attribute", "displayName": "Naming Strategy", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the the defined Property Naming Strategy.Possible values are: LOWER_CAMEL_CASE, LOWER_DOT_CASE, LOWER_CASE, KEBAB_CASE, SNAKE_CASE and UPPER_CAMEL_CASE" },
     "contentTypeHeader": { "index": 22, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshall [...]
-    "dateFormatPattern": { "index": 23, "kind": "attribute", "displayName": "Date Format Pattern", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To configure the date format while marshall or unmarshall Date fields in JSON using Gson" }
+    "dateFormatPattern": { "index": 23, "kind": "attribute", "displayName": "Date Format Pattern", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To configure the date format while marshall or unmarshall Date fields in JSON using Gson" },
+    "maxStringLength": { "index": 24, "kind": "attribute", "displayName": "Max String Length", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "Jackson. Sets the maximum string length (in chars or bytes, depending on input context). The default is 20,000,000. This limit is not exact, the limit is applied when we increase internal buffer sizes and an ex [...]
   }
 }
diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JacksonXMLDataFormat.java b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JacksonXMLDataFormat.java
index 429817b657a..9faf9f87835 100644
--- a/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JacksonXMLDataFormat.java
+++ b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JacksonXMLDataFormat.java
@@ -86,6 +86,9 @@ public class JacksonXMLDataFormat extends DataFormatDefinition implements Conten
               description = "Whether the data format should set the Content-Type header with the type from the data format."
                             + " For example application/xml for data formats marshalling to XML, or application/json for data formats marshalling to JSON")
     private String contentTypeHeader;
+    @XmlAttribute
+    @Metadata(label = "advanced", javaType = "java.lang.Integer")
+    private String maxStringLength;
 
     public JacksonXMLDataFormat() {
         super("jacksonXml");
@@ -112,6 +115,7 @@ public class JacksonXMLDataFormat extends DataFormatDefinition implements Conten
         this.enableFeatures = builder.enableFeatures;
         this.disableFeatures = builder.disableFeatures;
         this.contentTypeHeader = builder.contentTypeHeader;
+        this.maxStringLength = builder.maxStringLength;
     }
 
     private JacksonXMLDataFormat(Builder builder) {
@@ -135,6 +139,7 @@ public class JacksonXMLDataFormat extends DataFormatDefinition implements Conten
         this.enableFeatures = builder.enableFeatures;
         this.disableFeatures = builder.disableFeatures;
         this.contentTypeHeader = builder.contentTypeHeader;
+        this.maxStringLength = builder.maxStringLength;
     }
 
     @Override
@@ -371,6 +376,18 @@ public class JacksonXMLDataFormat extends DataFormatDefinition implements Conten
         this.timezone = timezone;
     }
 
+    public String getMaxStringLength() {
+        return maxStringLength;
+    }
+
+    /**
+     * Sets the maximum string length (in chars or bytes, depending on input context).
+     * The default is 20,000,000. This limit is not exact, the limit is applied when we increase internal buffer sizes and an exception will happen at sizes greater than this limit. Some text values that are a little bigger than the limit may be treated as valid but no text values with sizes less than or equal to this limit will be treated as invalid.
+     */
+    public void setMaxStringLength(String maxStringLength) {
+        this.maxStringLength = maxStringLength;
+    }
+
     /**
      * {@code Builder} is a specific builder for {@link JacksonXMLDataFormat}.
      */
@@ -396,6 +413,7 @@ public class JacksonXMLDataFormat extends DataFormatDefinition implements Conten
         private String enableFeatures;
         private String disableFeatures;
         private String contentTypeHeader;
+        private String maxStringLength;
 
         /**
          * Lookup and use the existing XmlMapper with the given id.
@@ -623,6 +641,15 @@ public class JacksonXMLDataFormat extends DataFormatDefinition implements Conten
             return this;
         }
 
+        /**
+         * Sets the maximum string length (in chars or bytes, depending on input context).
+         * The default is 20,000,000. This limit is not exact, the limit is applied when we increase internal buffer sizes and an exception will happen at sizes greater than this limit. Some text values that are a little bigger than the limit may be treated as valid but no text values with sizes less than or equal to this limit will be treated as invalid.
+         */
+        public Builder maxStringLength(String maxStringLength) {
+            this.maxStringLength = maxStringLength;
+            return this;
+        }
+
         @Override
         public JacksonXMLDataFormat end() {
             return new JacksonXMLDataFormat(this);
diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JsonDataFormat.java b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JsonDataFormat.java
index 56a4c5cd68e..f45b6e7f6ab 100644
--- a/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JsonDataFormat.java
+++ b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JsonDataFormat.java
@@ -112,6 +112,9 @@ public class JsonDataFormat extends DataFormatDefinition implements ContentTypeH
     @XmlAttribute
     @Metadata(description = "To configure the date format while marshall or unmarshall Date fields in JSON using Gson")
     private String dateFormatPattern;
+    @XmlAttribute
+    @Metadata(label = "advanced", javaType = "java.lang.Integer")
+    private String maxStringLength;
 
     public JsonDataFormat() {
         super("json");
@@ -150,6 +153,7 @@ public class JsonDataFormat extends DataFormatDefinition implements ContentTypeH
         this.namingStrategy = source.namingStrategy;
         this.contentTypeHeader = source.contentTypeHeader;
         this.dateFormatPattern = source.dateFormatPattern;
+        this.maxStringLength = source.maxStringLength;
     }
 
     private JsonDataFormat(Builder builder) {
@@ -180,6 +184,7 @@ public class JsonDataFormat extends DataFormatDefinition implements ContentTypeH
         this.namingStrategy = builder.namingStrategy;
         this.contentTypeHeader = builder.contentTypeHeader;
         this.dateFormatPattern = builder.dateFormatPattern;
+        this.maxStringLength = builder.maxStringLength;
     }
 
     @Override
@@ -498,6 +503,18 @@ public class JsonDataFormat extends DataFormatDefinition implements ContentTypeH
         this.namingStrategy = namingStrategy;
     }
 
+    public String getMaxStringLength() {
+        return maxStringLength;
+    }
+
+    /**
+     * Jackson. Sets the maximum string length (in chars or bytes, depending on input context).
+     * The default is 20,000,000. This limit is not exact, the limit is applied when we increase internal buffer sizes and an exception will happen at sizes greater than this limit. Some text values that are a little bigger than the limit may be treated as valid but no text values with sizes less than or equal to this limit will be treated as invalid.
+     */
+    public void setMaxStringLength(String maxStringLength) {
+        this.maxStringLength = maxStringLength;
+    }
+
     //
     // Fluent builders
     //
@@ -658,6 +675,7 @@ public class JsonDataFormat extends DataFormatDefinition implements ContentTypeH
         private String namingStrategy;
         private String contentTypeHeader;
         private String dateFormatPattern;
+        private String maxStringLength;
 
         /**
          * Whether the data format should set the Content-Type header with the type from the data format. For example
@@ -975,6 +993,15 @@ public class JsonDataFormat extends DataFormatDefinition implements ContentTypeH
             return this;
         }
 
+        /**
+         * Jackson. Sets the maximum string length (in chars or bytes, depending on input context).
+         * The default is 20,000,000. This limit is not exact, the limit is applied when we increase internal buffer sizes and an exception will happen at sizes greater than this limit. Some text values that are a little bigger than the limit may be treated as valid but no text values with sizes less than or equal to this limit will be treated as invalid.
+         */
+        public Builder maxStringLength(String maxStringLength) {
+            this.maxStringLength = maxStringLength;
+            return this;
+        }
+
         @Override
         public JsonDataFormat end() {
             return new JsonDataFormat(this);
diff --git a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/JacksonXMLDataFormatReifier.java b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/JacksonXMLDataFormatReifier.java
index 6241e65c3f8..f2c2a669dcd 100644
--- a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/JacksonXMLDataFormatReifier.java
+++ b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/JacksonXMLDataFormatReifier.java
@@ -45,6 +45,7 @@ public class JacksonXMLDataFormatReifier extends DataFormatReifier<JacksonXMLDat
         properties.put("disableFeatures", definition.getDisableFeatures());
         properties.put("allowUnmarshallType", definition.getAllowUnmarshallType());
         properties.put("timezone", definition.getTimezone());
+        properties.put("maxStringLength", definition.getMaxStringLength());
     }
 
 }
diff --git a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/JsonDataFormatReifier.java b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/JsonDataFormatReifier.java
index 76ce3933b51..83f0339814b 100644
--- a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/JsonDataFormatReifier.java
+++ b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/JsonDataFormatReifier.java
@@ -61,6 +61,7 @@ public class JsonDataFormatReifier extends DataFormatReifier<JsonDataFormat> {
             properties.put("autoDiscoverSchemaResolver", definition.getAutoDiscoverSchemaResolver());
             properties.put("namingStrategy", definition.getNamingStrategy());
             properties.put("timezone", definition.getTimezone());
+            properties.put("maxStringLength", definition.getMaxStringLength());
         }
         if (definition.getLibrary() == JsonLibrary.Fastjson || definition.getLibrary() == JsonLibrary.Gson) {
             properties.put("dateFormatPattern", definition.getDateFormatPattern());
diff --git a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java
index b20b14fdefd..d02a342474d 100644
--- a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java
+++ b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java
@@ -1979,6 +1979,7 @@ public class ModelParser extends BaseParser {
                 case "enableJaxbAnnotationModule": def.setEnableJaxbAnnotationModule(val); yield true;
                 case "include": def.setInclude(val); yield true;
                 case "jsonView": def.setJsonViewTypeName(val); yield true;
+                case "maxStringLength": def.setMaxStringLength(val); yield true;
                 case "moduleClassNames": def.setModuleClassNames(val); yield true;
                 case "moduleRefs": def.setModuleRefs(val); yield true;
                 case "prettyPrint": def.setPrettyPrint(val); yield true;
@@ -2036,6 +2037,7 @@ public class ModelParser extends BaseParser {
                 case "include": def.setInclude(val); yield true;
                 case "jsonView": def.setJsonViewTypeName(val); yield true;
                 case "library": def.setLibrary(JsonLibrary.valueOf(val)); yield true;
+                case "maxStringLength": def.setMaxStringLength(val); yield true;
                 case "moduleClassNames": def.setModuleClassNames(val); yield true;
                 case "moduleRefs": def.setModuleRefs(val); yield true;
                 case "namingStrategy": def.setNamingStrategy(val); yield true;
diff --git a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java
index 233a8d93ae8..0e28133c7a9 100644
--- a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java
+++ b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java
@@ -2678,6 +2678,7 @@ public class ModelWriter extends BaseWriter {
         doWriteAttribute("jsonView", def.getJsonViewTypeName(), null);
         doWriteAttribute("enableFeatures", def.getEnableFeatures(), null);
         doWriteAttribute("useList", def.getUseList(), null);
+        doWriteAttribute("maxStringLength", def.getMaxStringLength(), null);
         doWriteAttribute("disableFeatures", def.getDisableFeatures(), null);
         doWriteAttribute("moduleRefs", def.getModuleRefs(), null);
         doWriteAttribute("enableJaxbAnnotationModule", def.getEnableJaxbAnnotationModule(), null);
@@ -2735,6 +2736,7 @@ public class ModelWriter extends BaseWriter {
         doWriteAttribute("unmarshalType", def.getUnmarshalTypeName(), null);
         doWriteAttribute("autoDiscoverSchemaResolver", def.getAutoDiscoverSchemaResolver(), "true");
         doWriteAttribute("useList", def.getUseList(), null);
+        doWriteAttribute("maxStringLength", def.getMaxStringLength(), null);
         doWriteAttribute("disableFeatures", def.getDisableFeatures(), null);
         doWriteAttribute("moduleRefs", def.getModuleRefs(), null);
         doWriteAttribute("schemaResolver", def.getSchemaResolver(), null);
diff --git a/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java b/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java
index bddc904100d..a53c5c4e591 100644
--- a/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java
+++ b/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java
@@ -2678,6 +2678,7 @@ public class ModelWriter extends BaseWriter {
         doWriteAttribute("jsonView", def.getJsonViewTypeName(), null);
         doWriteAttribute("enableFeatures", def.getEnableFeatures(), null);
         doWriteAttribute("useList", def.getUseList(), null);
+        doWriteAttribute("maxStringLength", def.getMaxStringLength(), null);
         doWriteAttribute("disableFeatures", def.getDisableFeatures(), null);
         doWriteAttribute("moduleRefs", def.getModuleRefs(), null);
         doWriteAttribute("enableJaxbAnnotationModule", def.getEnableJaxbAnnotationModule(), null);
@@ -2735,6 +2736,7 @@ public class ModelWriter extends BaseWriter {
         doWriteAttribute("unmarshalType", def.getUnmarshalTypeName(), null);
         doWriteAttribute("autoDiscoverSchemaResolver", def.getAutoDiscoverSchemaResolver(), "true");
         doWriteAttribute("useList", def.getUseList(), null);
+        doWriteAttribute("maxStringLength", def.getMaxStringLength(), null);
         doWriteAttribute("disableFeatures", def.getDisableFeatures(), null);
         doWriteAttribute("moduleRefs", def.getModuleRefs(), null);
         doWriteAttribute("schemaResolver", def.getSchemaResolver(), null);
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java
index 65fba7ef9ca..a17a97a1b04 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java
@@ -7555,6 +7555,7 @@ public final class ModelDeserializers extends YamlDeserializerSupport {
                     @YamlProperty(name = "id", type = "string", description = "The id of this node", displayName = "Id"),
                     @YamlProperty(name = "include", type = "string", description = "If you want to marshal a pojo to JSON, and the pojo has some fields with null values. And you want to skip these null values, you can set this option to NON_NULL", displayName = "Include"),
                     @YamlProperty(name = "jsonView", type = "string", description = "When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output. With Jackson you can use JSON views to accomplish this. This option is to refer to the class which has JsonView annotations", displayName = "Json View"),
+                    @YamlProperty(name = "maxStringLength", type = "number", description = "Sets the maximum string length (in chars or bytes, depending on input context). The default is 20,000,000. This limit is not exact, the limit is applied when we increase internal buffer sizes and an exception will happen at sizes greater than this limit. Some text values that are a little bigger than the limit may be treated as valid but no text values with sizes less than or equal to this limit w [...]
                     @YamlProperty(name = "moduleClassNames", type = "string", description = "To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma.", displayName = "Module Class Names"),
                     @YamlProperty(name = "moduleRefs", type = "string", description = "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma.", displayName = "Module Refs"),
                     @YamlProperty(name = "prettyPrint", type = "boolean", description = "To enable pretty printing output nicely formatted. Is by default false.", displayName = "Pretty Print"),
@@ -7629,6 +7630,11 @@ public final class ModelDeserializers extends YamlDeserializerSupport {
                     target.setJsonViewTypeName(val);
                     break;
                 }
+                case "maxStringLength": {
+                    String val = asText(node);
+                    target.setMaxStringLength(val);
+                    break;
+                }
                 case "moduleClassNames": {
                     String val = asText(node);
                     target.setModuleClassNames(val);
@@ -8222,6 +8228,7 @@ public final class ModelDeserializers extends YamlDeserializerSupport {
                     @YamlProperty(name = "include", type = "string", description = "If you want to marshal a pojo to JSON, and the pojo has some fields with null values. And you want to skip these null values, you can set this option to NON_NULL", displayName = "Include"),
                     @YamlProperty(name = "jsonView", type = "string", description = "When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output. With Jackson you can use JSON views to accomplish this. This option is to refer to the class which has JsonView annotations", displayName = "Json View"),
                     @YamlProperty(name = "library", type = "enum:Fastjson,Gson,Jackson,Jsonb", defaultValue = "Jackson", description = "Which json library to use.", displayName = "Library"),
+                    @YamlProperty(name = "maxStringLength", type = "number", description = "Jackson. Sets the maximum string length (in chars or bytes, depending on input context). The default is 20,000,000. This limit is not exact, the limit is applied when we increase internal buffer sizes and an exception will happen at sizes greater than this limit. Some text values that are a little bigger than the limit may be treated as valid but no text values with sizes less than or equal to thi [...]
                     @YamlProperty(name = "moduleClassNames", type = "string", description = "To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma.", displayName = "Module Class Names"),
                     @YamlProperty(name = "moduleRefs", type = "string", description = "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma.", displayName = "Module Refs"),
                     @YamlProperty(name = "namingStrategy", type = "string", description = "If set then Jackson will use the the defined Property Naming Strategy.Possible values are: LOWER_CAMEL_CASE, LOWER_DOT_CASE, LOWER_CASE, KEBAB_CASE, SNAKE_CASE and UPPER_CAMEL_CASE", displayName = "Naming Strategy"),
@@ -8318,6 +8325,11 @@ public final class ModelDeserializers extends YamlDeserializerSupport {
                     target.setLibrary(asEnum(node, org.apache.camel.model.dataformat.JsonLibrary.class));
                     break;
                 }
+                case "maxStringLength": {
+                    String val = asText(node);
+                    target.setMaxStringLength(val);
+                    break;
+                }
                 case "moduleClassNames": {
                     String val = asText(node);
                     target.setModuleClassNames(val);
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json
index 52ea90a61d3..edf7f365b4b 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json
@@ -11195,6 +11195,11 @@
             "title" : "Json View",
             "description" : "When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output. With Jackson you can use JSON views to accomplish this. This option is to refer to the class which has JsonView annotations"
           },
+          "maxStringLength" : {
+            "type" : "number",
+            "title" : "Max String Length",
+            "description" : "Sets the maximum string length (in chars or bytes, depending on input context). The default is 20,000,000. This limit is not exact, the limit is applied when we increase internal buffer sizes and an exception will happen at sizes greater than this limit. Some text values that are a little bigger than the limit may be treated as valid but no text values with sizes less than or equal to this limit will be treated as invalid."
+          },
           "moduleClassNames" : {
             "type" : "string",
             "title" : "Module Class Names",
@@ -11450,6 +11455,11 @@
             "default" : "Jackson",
             "enum" : [ "Fastjson", "Gson", "Jackson", "Jsonb" ]
           },
+          "maxStringLength" : {
+            "type" : "number",
+            "title" : "Max String Length",
+            "description" : "Jackson. Sets the maximum string length (in chars or bytes, depending on input context). The default is 20,000,000. This limit is not exact, the limit is applied when we increase internal buffer sizes and an exception will happen at sizes greater than this limit. Some text values that are a little bigger than the limit may be treated as valid but no text values with sizes less than or equal to this limit will be treated as invalid."
+          },
           "moduleClassNames" : {
             "type" : "string",
             "title" : "Module Class Names",