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

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

commit 115d0ae71361086d8ddac95b318a7479dba8784b
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Nov 25 14:17:04 2026 +0100

    CAMEL-25021: camel-kafka - document that a record larger than 
maxPartitionFetchBytes is still fetched
    
    The description of maxPartitionFetchBytes still had the wording from before
    KIP-74 (Kafka 0.10.1): that the consumer can get stuck on a record larger 
than
    this limit. The broker returns the first record batch even when it is 
larger,
    so the consumer makes progress. Use the wording of the Kafka documentation, 
and
    add an integration test that consumes a 3 MB record with the default 1 MB 
limit.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    Signed-off-by: Claus Ibsen <[email protected]>
---
 .../org/apache/camel/catalog/components/kafka.json |  4 +-
 .../org/apache/camel/component/kafka/kafka.json    |  4 +-
 .../camel/component/kafka/KafkaConfiguration.java  | 11 +--
 .../integration/KafkaConsumerLargeRecordIT.java    | 98 ++++++++++++++++++++++
 .../dsl/KafkaComponentBuilderFactory.java          | 14 ++--
 .../endpoint/dsl/KafkaEndpointBuilderFactory.java  | 28 +++----
 6 files changed, 129 insertions(+), 30 deletions(-)

diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/kafka.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/kafka.json
index f4fe350ad9e9..92d2fea77e00 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/kafka.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/kafka.json
@@ -64,7 +64,7 @@
     "headerDeserializer": { "index": 37, "kind": "property", "displayName": 
"Header Deserializer", "group": "consumer", "label": "consumer", "required": 
false, "type": "object", "javaType": 
"org.apache.camel.component.kafka.serde.KafkaHeaderDeserializer", "deprecated": 
false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "To use a custom KafkaHeaderDeserializer to des 
[...]
     "heartbeatIntervalMs": { "index": 38, "kind": "property", "displayName": 
"Heartbeat Interval Ms", "group": "consumer", "label": "consumer", "required": 
false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": 3000, 
"configurationClass": "org.apache.camel.component.kafka.KafkaConfiguration", 
"configurationField": "configuration", "description": "The expected time 
between heartbeats to the consumer coordinator  [...]
     "keyDeserializer": { "index": 39, "kind": "property", "displayName": "Key 
Deserializer", "group": "consumer", "label": "consumer", "required": false, 
"type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": 
"org.apache.kafka.common.serialization.StringDeserializer", 
"configurationClass": "org.apache.camel.component.kafka.KafkaConfiguration", 
"configurationField": "configuration", "description": "Deserializer class for 
[...]
-    "maxPartitionFetchBytes": { "index": 40, "kind": "property", 
"displayName": "Max Partition Fetch Bytes", "group": "consumer", "label": 
"consumer", "required": false, "type": "integer", "javaType": 
"java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": 1048576, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The maximum amount of data per-partition the 
server wil [...]
+    "maxPartitionFetchBytes": { "index": 40, "kind": "property", 
"displayName": "Max Partition Fetch Bytes", "group": "consumer", "label": 
"consumer", "required": false, "type": "integer", "javaType": 
"java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": 1048576, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The maximum amount of data per-partition the 
server wil [...]
     "maxPollIntervalMs": { "index": 41, "kind": "property", "displayName": 
"Max Poll Interval Ms", "group": "consumer", "label": "consumer", "required": 
false, "type": "duration", "javaType": "java.lang.Integer", "deprecated": 
false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The maximum delay between invocations of 
poll() when using consumer group management. Thi [...]
     "maxPollRecords": { "index": 42, "kind": "property", "displayName": "Max 
Poll Records", "group": "consumer", "label": "consumer", "required": false, 
"type": "integer", "javaType": "java.lang.Integer", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": 500, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The maximum number of records returned in a 
single call to poll()" },
     "offsetRepository": { "index": 43, "kind": "property", "displayName": 
"Offset Repository", "group": "consumer", "label": "consumer", "required": 
false, "type": "object", "javaType": 
"org.apache.camel.spi.StateRepository<java.lang.String, java.lang.String>", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The offset repository to use to locally  [...]
@@ -224,7 +224,7 @@
     "headerDeserializer": { "index": 36, "kind": "parameter", "displayName": 
"Header Deserializer", "group": "consumer", "label": "consumer", "required": 
false, "type": "object", "javaType": 
"org.apache.camel.component.kafka.serde.KafkaHeaderDeserializer", "deprecated": 
false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "To use a custom KafkaHeaderDeserializer to de 
[...]
     "heartbeatIntervalMs": { "index": 37, "kind": "parameter", "displayName": 
"Heartbeat Interval Ms", "group": "consumer", "label": "consumer", "required": 
false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": 3000, 
"configurationClass": "org.apache.camel.component.kafka.KafkaConfiguration", 
"configurationField": "configuration", "description": "The expected time 
between heartbeats to the consumer coordinator [...]
     "keyDeserializer": { "index": 38, "kind": "parameter", "displayName": "Key 
Deserializer", "group": "consumer", "label": "consumer", "required": false, 
"type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": 
"org.apache.kafka.common.serialization.StringDeserializer", 
"configurationClass": "org.apache.camel.component.kafka.KafkaConfiguration", 
"configurationField": "configuration", "description": "Deserializer class fo 
[...]
-    "maxPartitionFetchBytes": { "index": 39, "kind": "parameter", 
"displayName": "Max Partition Fetch Bytes", "group": "consumer", "label": 
"consumer", "required": false, "type": "integer", "javaType": 
"java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": 1048576, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The maximum amount of data per-partition the 
server wi [...]
+    "maxPartitionFetchBytes": { "index": 39, "kind": "parameter", 
"displayName": "Max Partition Fetch Bytes", "group": "consumer", "label": 
"consumer", "required": false, "type": "integer", "javaType": 
"java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": 1048576, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The maximum amount of data per-partition the 
server wi [...]
     "maxPollIntervalMs": { "index": 40, "kind": "parameter", "displayName": 
"Max Poll Interval Ms", "group": "consumer", "label": "consumer", "required": 
false, "type": "duration", "javaType": "java.lang.Integer", "deprecated": 
false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The maximum delay between invocations of 
poll() when using consumer group management. Th [...]
     "maxPollRecords": { "index": 41, "kind": "parameter", "displayName": "Max 
Poll Records", "group": "consumer", "label": "consumer", "required": false, 
"type": "integer", "javaType": "java.lang.Integer", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": 500, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The maximum number of records returned in a 
single call to poll()" },
     "offsetRepository": { "index": 42, "kind": "parameter", "displayName": 
"Offset Repository", "group": "consumer", "label": "consumer", "required": 
false, "type": "object", "javaType": 
"org.apache.camel.spi.StateRepository<java.lang.String, java.lang.String>", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The offset repository to use to locally [...]
diff --git 
a/components/camel-kafka/src/generated/resources/META-INF/org/apache/camel/component/kafka/kafka.json
 
b/components/camel-kafka/src/generated/resources/META-INF/org/apache/camel/component/kafka/kafka.json
index f4fe350ad9e9..92d2fea77e00 100644
--- 
a/components/camel-kafka/src/generated/resources/META-INF/org/apache/camel/component/kafka/kafka.json
+++ 
b/components/camel-kafka/src/generated/resources/META-INF/org/apache/camel/component/kafka/kafka.json
@@ -64,7 +64,7 @@
     "headerDeserializer": { "index": 37, "kind": "property", "displayName": 
"Header Deserializer", "group": "consumer", "label": "consumer", "required": 
false, "type": "object", "javaType": 
"org.apache.camel.component.kafka.serde.KafkaHeaderDeserializer", "deprecated": 
false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "To use a custom KafkaHeaderDeserializer to des 
[...]
     "heartbeatIntervalMs": { "index": 38, "kind": "property", "displayName": 
"Heartbeat Interval Ms", "group": "consumer", "label": "consumer", "required": 
false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": 3000, 
"configurationClass": "org.apache.camel.component.kafka.KafkaConfiguration", 
"configurationField": "configuration", "description": "The expected time 
between heartbeats to the consumer coordinator  [...]
     "keyDeserializer": { "index": 39, "kind": "property", "displayName": "Key 
Deserializer", "group": "consumer", "label": "consumer", "required": false, 
"type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": 
"org.apache.kafka.common.serialization.StringDeserializer", 
"configurationClass": "org.apache.camel.component.kafka.KafkaConfiguration", 
"configurationField": "configuration", "description": "Deserializer class for 
[...]
-    "maxPartitionFetchBytes": { "index": 40, "kind": "property", 
"displayName": "Max Partition Fetch Bytes", "group": "consumer", "label": 
"consumer", "required": false, "type": "integer", "javaType": 
"java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": 1048576, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The maximum amount of data per-partition the 
server wil [...]
+    "maxPartitionFetchBytes": { "index": 40, "kind": "property", 
"displayName": "Max Partition Fetch Bytes", "group": "consumer", "label": 
"consumer", "required": false, "type": "integer", "javaType": 
"java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": 1048576, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The maximum amount of data per-partition the 
server wil [...]
     "maxPollIntervalMs": { "index": 41, "kind": "property", "displayName": 
"Max Poll Interval Ms", "group": "consumer", "label": "consumer", "required": 
false, "type": "duration", "javaType": "java.lang.Integer", "deprecated": 
false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The maximum delay between invocations of 
poll() when using consumer group management. Thi [...]
     "maxPollRecords": { "index": 42, "kind": "property", "displayName": "Max 
Poll Records", "group": "consumer", "label": "consumer", "required": false, 
"type": "integer", "javaType": "java.lang.Integer", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": 500, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The maximum number of records returned in a 
single call to poll()" },
     "offsetRepository": { "index": 43, "kind": "property", "displayName": 
"Offset Repository", "group": "consumer", "label": "consumer", "required": 
false, "type": "object", "javaType": 
"org.apache.camel.spi.StateRepository<java.lang.String, java.lang.String>", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The offset repository to use to locally  [...]
@@ -224,7 +224,7 @@
     "headerDeserializer": { "index": 36, "kind": "parameter", "displayName": 
"Header Deserializer", "group": "consumer", "label": "consumer", "required": 
false, "type": "object", "javaType": 
"org.apache.camel.component.kafka.serde.KafkaHeaderDeserializer", "deprecated": 
false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "To use a custom KafkaHeaderDeserializer to de 
[...]
     "heartbeatIntervalMs": { "index": 37, "kind": "parameter", "displayName": 
"Heartbeat Interval Ms", "group": "consumer", "label": "consumer", "required": 
false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": 3000, 
"configurationClass": "org.apache.camel.component.kafka.KafkaConfiguration", 
"configurationField": "configuration", "description": "The expected time 
between heartbeats to the consumer coordinator [...]
     "keyDeserializer": { "index": 38, "kind": "parameter", "displayName": "Key 
Deserializer", "group": "consumer", "label": "consumer", "required": false, 
"type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": 
"org.apache.kafka.common.serialization.StringDeserializer", 
"configurationClass": "org.apache.camel.component.kafka.KafkaConfiguration", 
"configurationField": "configuration", "description": "Deserializer class fo 
[...]
-    "maxPartitionFetchBytes": { "index": 39, "kind": "parameter", 
"displayName": "Max Partition Fetch Bytes", "group": "consumer", "label": 
"consumer", "required": false, "type": "integer", "javaType": 
"java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": 1048576, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The maximum amount of data per-partition the 
server wi [...]
+    "maxPartitionFetchBytes": { "index": 39, "kind": "parameter", 
"displayName": "Max Partition Fetch Bytes", "group": "consumer", "label": 
"consumer", "required": false, "type": "integer", "javaType": 
"java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": 1048576, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The maximum amount of data per-partition the 
server wi [...]
     "maxPollIntervalMs": { "index": 40, "kind": "parameter", "displayName": 
"Max Poll Interval Ms", "group": "consumer", "label": "consumer", "required": 
false, "type": "duration", "javaType": "java.lang.Integer", "deprecated": 
false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The maximum delay between invocations of 
poll() when using consumer group management. Th [...]
     "maxPollRecords": { "index": 41, "kind": "parameter", "displayName": "Max 
Poll Records", "group": "consumer", "label": "consumer", "required": false, 
"type": "integer", "javaType": "java.lang.Integer", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": 500, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The maximum number of records returned in a 
single call to poll()" },
     "offsetRepository": { "index": 42, "kind": "parameter", "displayName": 
"Offset Repository", "group": "consumer", "label": "consumer", "required": 
false, "type": "object", "javaType": 
"org.apache.camel.spi.StateRepository<java.lang.String, java.lang.String>", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The offset repository to use to locally [...]
diff --git 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConfiguration.java
 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConfiguration.java
index 3cb66fd2a018..1fa0f5a9ce7f 100755
--- 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConfiguration.java
+++ 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConfiguration.java
@@ -59,7 +59,7 @@ public class KafkaConfiguration extends 
KafkaClientConfiguration {
     // fetch.min.bytes
     @UriParam(label = "consumer", defaultValue = "1")
     private Integer fetchMinBytes = 1;
-    // fetch.min.bytes
+    // fetch.max.bytes
     @UriParam(label = "consumer", defaultValue = "52428800")
     private Integer fetchMaxBytes = 50 * 1024 * 1024;
     // heartbeat.interval.ms
@@ -810,10 +810,11 @@ public class KafkaConfiguration extends 
KafkaClientConfiguration {
     }
 
     /**
-     * The maximum amount of data per-partition the server will return. The 
maximum total memory used for a request will
-     * be #partitions * max.partition.fetch.bytes. This size must be at least 
as large as the maximum message size the
-     * server allows or else it is possible for the producer to send messages 
larger than the consumer can fetch. If
-     * that happens, the consumer can get stuck trying to fetch a large 
message on a certain partition.
+     * The maximum amount of data per-partition the server will return. This 
is not an absolute maximum, if the first
+     * record batch in the first non-empty partition of the fetch is larger 
than this value, the batch will still be
+     * returned to ensure that the consumer can make progress. The maximum 
record batch size accepted by the broker is
+     * defined via message.max.bytes (broker config) or max.message.bytes 
(topic config). See fetchMaxBytes for limiting
+     * the consumer request size.
      */
     public void setMaxPartitionFetchBytes(Integer maxPartitionFetchBytes) {
         this.maxPartitionFetchBytes = maxPartitionFetchBytes;
diff --git 
a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerLargeRecordIT.java
 
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerLargeRecordIT.java
new file mode 100644
index 000000000000..6a3caaaaa71f
--- /dev/null
+++ 
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerLargeRecordIT.java
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.kafka.integration;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.UUID;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.kafka.integration.common.KafkaTestUtil;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.kafka.clients.admin.AlterConfigOp;
+import org.apache.kafka.clients.admin.ConfigEntry;
+import org.apache.kafka.clients.producer.KafkaProducer;
+import org.apache.kafka.clients.producer.ProducerConfig;
+import org.apache.kafka.clients.producer.ProducerRecord;
+import org.apache.kafka.common.config.ConfigResource;
+import org.apache.kafka.common.config.TopicConfig;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * A record larger than max.partition.fetch.bytes (1 MB by default) must not 
stall the consumer (CAMEL-25021).
+ */
+public class KafkaConsumerLargeRecordIT extends BaseKafkaTestSupport {
+    private static final String TOPIC = "large-record-" + UUID.randomUUID();
+    private static final int LARGE_SIZE = 3 * 1024 * 1024;
+
+    private KafkaProducer<String, String> producer;
+
+    @BeforeEach
+    public void before() throws Exception {
+        // the consumer of the route may have created the topic already, so 
raise its limit afterwards
+        ConfigResource resource = new 
ConfigResource(ConfigResource.Type.TOPIC, TOPIC);
+        AlterConfigOp op = new AlterConfigOp(
+                new ConfigEntry(TopicConfig.MAX_MESSAGE_BYTES_CONFIG, 
String.valueOf(10 * 1024 * 1024)),
+                AlterConfigOp.OpType.SET);
+        kafkaAdminClient.incrementalAlterConfigs(Map.of(resource, 
List.of(op))).all().get(30, TimeUnit.SECONDS);
+
+        Properties props = getDefaultProperties();
+        props.put(ProducerConfig.MAX_REQUEST_SIZE_CONFIG, 10 * 1024 * 1024);
+        producer = new KafkaProducer<>(props);
+    }
+
+    @AfterEach
+    public void after() {
+        if (producer != null) {
+            producer.close();
+        }
+        kafkaAdminClient.deleteTopics(Collections.singletonList(TOPIC));
+    }
+
+    @Test
+    public void shouldConsumeRecordLargerThanMaxPartitionFetchBytes() throws 
Exception {
+        MockEndpoint result = 
contextExtension.getMockEndpoint(KafkaTestUtil.MOCK_RESULT);
+        result.expectedMessageCount(3);
+
+        producer.send(new ProducerRecord<>(TOPIC, "1", 
"small-before")).get(30, TimeUnit.SECONDS);
+        producer.send(new ProducerRecord<>(TOPIC, "1", 
"x".repeat(LARGE_SIZE))).get(30, TimeUnit.SECONDS);
+        producer.send(new ProducerRecord<>(TOPIC, "1", "small-after")).get(30, 
TimeUnit.SECONDS);
+
+        MockEndpoint.assertIsSatisfied(30, TimeUnit.SECONDS, result);
+        assertEquals("small-before", 
result.getExchanges().get(0).getMessage().getBody(String.class));
+        assertEquals(LARGE_SIZE, 
result.getExchanges().get(1).getMessage().getBody(String.class).length());
+        assertEquals("small-after", 
result.getExchanges().get(2).getMessage().getBody(String.class));
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            @Override
+            public void configure() {
+                from("kafka:" + TOPIC + "?groupId=" + UUID.randomUUID() + 
"&autoOffsetReset=earliest")
+                        .to(KafkaTestUtil.MOCK_RESULT);
+            }
+        };
+    }
+}
diff --git 
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/KafkaComponentBuilderFactory.java
 
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/KafkaComponentBuilderFactory.java
index 15d69cc3da3a..704d9915d99e 100644
--- 
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/KafkaComponentBuilderFactory.java
+++ 
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/KafkaComponentBuilderFactory.java
@@ -869,13 +869,13 @@ public interface KafkaComponentBuilderFactory {
     
         
         /**
-         * The maximum amount of data per-partition the server will return. The
-         * maximum total memory used for a request will be #partitions *
-         * max.partition.fetch.bytes. This size must be at least as large as 
the
-         * maximum message size the server allows or else it is possible for 
the
-         * producer to send messages larger than the consumer can fetch. If 
that
-         * happens, the consumer can get stuck trying to fetch a large message
-         * on a certain partition.
+         * The maximum amount of data per-partition the server will return. 
This
+         * is not an absolute maximum, if the first record batch in the first
+         * non-empty partition of the fetch is larger than this value, the 
batch
+         * will still be returned to ensure that the consumer can make 
progress.
+         * The maximum record batch size accepted by the broker is defined via
+         * message.max.bytes (broker config) or max.message.bytes (topic
+         * config). See fetchMaxBytes for limiting the consumer request size.
          * 
          * The option is a: &lt;code&gt;java.lang.Integer&lt;/code&gt; type.
          * 
diff --git 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/KafkaEndpointBuilderFactory.java
 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/KafkaEndpointBuilderFactory.java
index 3763cb9036f0..485bba8281ed 100644
--- 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/KafkaEndpointBuilderFactory.java
+++ 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/KafkaEndpointBuilderFactory.java
@@ -1309,13 +1309,13 @@ public interface KafkaEndpointBuilderFactory {
             return this;
         }
         /**
-         * The maximum amount of data per-partition the server will return. The
-         * maximum total memory used for a request will be #partitions *
-         * max.partition.fetch.bytes. This size must be at least as large as 
the
-         * maximum message size the server allows or else it is possible for 
the
-         * producer to send messages larger than the consumer can fetch. If 
that
-         * happens, the consumer can get stuck trying to fetch a large message
-         * on a certain partition.
+         * The maximum amount of data per-partition the server will return. 
This
+         * is not an absolute maximum, if the first record batch in the first
+         * non-empty partition of the fetch is larger than this value, the 
batch
+         * will still be returned to ensure that the consumer can make 
progress.
+         * The maximum record batch size accepted by the broker is defined via
+         * message.max.bytes (broker config) or max.message.bytes (topic
+         * config). See fetchMaxBytes for limiting the consumer request size.
          * 
          * The option is a: <code>java.lang.Integer</code> type.
          * 
@@ -1330,13 +1330,13 @@ public interface KafkaEndpointBuilderFactory {
             return this;
         }
         /**
-         * The maximum amount of data per-partition the server will return. The
-         * maximum total memory used for a request will be #partitions *
-         * max.partition.fetch.bytes. This size must be at least as large as 
the
-         * maximum message size the server allows or else it is possible for 
the
-         * producer to send messages larger than the consumer can fetch. If 
that
-         * happens, the consumer can get stuck trying to fetch a large message
-         * on a certain partition.
+         * The maximum amount of data per-partition the server will return. 
This
+         * is not an absolute maximum, if the first record batch in the first
+         * non-empty partition of the fetch is larger than this value, the 
batch
+         * will still be returned to ensure that the consumer can make 
progress.
+         * The maximum record batch size accepted by the broker is defined via
+         * message.max.bytes (broker config) or max.message.bytes (topic
+         * config). See fetchMaxBytes for limiting the consumer request size.
          * 
          * The option will be converted to a <code>java.lang.Integer</code>
          * type.

Reply via email to