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

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


The following commit(s) were added to refs/heads/main by this push:
     new f997930ad7f0 CAMEL-27059, CAMEL-27075: camel-kafka - a consumer 
without groupId logs a WARN about its generated group, and uses the group.id 
set in additionalProperties (#30231)
f997930ad7f0 is described below

commit f997930ad7f00a7ff589a1a6cc0c1987790d5a13
Author: Federico Mariani <[email protected]>
AuthorDate: Tue Nov 17 13:20:51 2026 +0100

    CAMEL-27059, CAMEL-27075: camel-kafka - a consumer without groupId logs a 
WARN about its generated group, and uses the group.id set in 
additionalProperties (#30231)
    
    * CAMEL-27059: camel-kafka - a consumer without groupId logs a WARN that it 
uses a new generated consumer group at each start
    
    The groupId option description and the component page say what happens 
without groupId, and the consumer examples set it.
    
    * CAMEL-27075: camel-kafka - a consumer without groupId uses the group.id 
set in additionalProperties
    
    The consumer generates a group id, and logs the WARN about it, only when 
neither groupId nor additionalProperties set
    the group. groupId still takes precedence when both are set.
    
    * CAMEL-27075: camel-kafka - the docs say a group.id set on the component 
puts all the consumers without groupId in one group
    
    With group.id in the additionalProperties of the component, every consumer 
endpoint without groupId now joins that one
    group, where before each had a generated group of its own, so routes that 
consume the same topic share its records.
    The upgrade guide entry and the Consumer groups section of the component 
page say so; the guide says to set groupId
    on each route that must receive every record.
---
 .../org/apache/camel/catalog/components/kafka.json |   4 +-
 .../apache/camel/catalog/docs/kafka-component.adoc |  44 +++-
 .../org/apache/camel/component/kafka/kafka.json    |   4 +-
 .../camel-kafka/src/main/docs/kafka-component.adoc |  44 +++-
 .../camel/component/kafka/KafkaConfiguration.java  |   7 +-
 .../camel/component/kafka/KafkaConsumer.java       |  26 ++-
 .../component/kafka/KafkaConsumerGroupIdTest.java  | 249 +++++++++++++++++++++
 .../ROOT/pages/camel-4x-upgrade-guide-4_24.adoc    |  19 ++
 .../dsl/KafkaComponentBuilderFactory.java          |   8 +-
 .../endpoint/dsl/KafkaEndpointBuilderFactory.java  |   8 +-
 10 files changed, 385 insertions(+), 28 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 d051d1c23d53..1a9e7f4c66ef 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
@@ -57,7 +57,7 @@
     "fetchMaxBytes": { "index": 30, "kind": "property", "displayName": "Fetch 
Max Bytes", "group": "consumer", "label": "consumer", "required": false, 
"type": "integer", "javaType": "java.lang.Integer", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": 52428800, 
"configurationClass": "org.apache.camel.component.kafka.KafkaConfiguration", 
"configurationField": "configuration", "description": "The maximum amount of 
data the server should return for a fetch request.  [...]
     "fetchMinBytes": { "index": 31, "kind": "property", "displayName": "Fetch 
Min Bytes", "group": "consumer", "label": "consumer", "required": false, 
"type": "integer", "javaType": "java.lang.Integer", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": 1, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The minimum amount of data the server should 
return for a fetch request. If insu [...]
     "fetchWaitMaxMs": { "index": 32, "kind": "property", "displayName": "Fetch 
Wait Max Ms", "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 amount of time the server will 
block before answering the fetch [...]
-    "groupId": { "index": 33, "kind": "property", "displayName": "Group Id", 
"group": "consumer", "label": "consumer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "A string that uniquely identifies the group of 
consumer processes to which this consumer belongs. By setting the s [...]
+    "groupId": { "index": 33, "kind": "property", "displayName": "Group Id", 
"group": "consumer", "label": "consumer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "A string that uniquely identifies the group of 
consumer processes to which this consumer belongs. By setting the s [...]
     "groupInstanceId": { "index": 34, "kind": "property", "displayName": 
"Group Instance Id", "group": "consumer", "label": "consumer", "required": 
false, "type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "A unique identifier of the consumer instance 
provided by the end user. Only non-empty strings are [...]
     "groupProtocol": { "index": 35, "kind": "property", "displayName": "Group 
Protocol", "group": "consumer", "label": "consumer", "required": false, "type": 
"enum", "javaType": "java.lang.String", "enum": [ "classic", "consumer" ], 
"deprecated": false, "autowired": false, "secret": false, "defaultValue": 
"classic", "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The consumer group protocol to use. The cl 
[...]
     "groupRemoteAssignor": { "index": 36, "kind": "property", "displayName": 
"Group Remote Assignor", "group": "consumer", "label": "consumer", "required": 
false, "type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The name of the server-side assignor to use 
when group.protocol is set to consumer. If no [...]
@@ -209,7 +209,7 @@
     "fetchMaxBytes": { "index": 29, "kind": "parameter", "displayName": "Fetch 
Max Bytes", "group": "consumer", "label": "consumer", "required": false, 
"type": "integer", "javaType": "java.lang.Integer", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": 52428800, 
"configurationClass": "org.apache.camel.component.kafka.KafkaConfiguration", 
"configurationField": "configuration", "description": "The maximum amount of 
data the server should return for a fetch request. [...]
     "fetchMinBytes": { "index": 30, "kind": "parameter", "displayName": "Fetch 
Min Bytes", "group": "consumer", "label": "consumer", "required": false, 
"type": "integer", "javaType": "java.lang.Integer", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": 1, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The minimum amount of data the server should 
return for a fetch request. If ins [...]
     "fetchWaitMaxMs": { "index": 31, "kind": "parameter", "displayName": 
"Fetch Wait Max Ms", "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 amount of time the server will 
block before answering the fetc [...]
-    "groupId": { "index": 32, "kind": "parameter", "displayName": "Group Id", 
"group": "consumer", "label": "consumer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "A string that uniquely identifies the group of 
consumer processes to which this consumer belongs. By setting the  [...]
+    "groupId": { "index": 32, "kind": "parameter", "displayName": "Group Id", 
"group": "consumer", "label": "consumer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "A string that uniquely identifies the group of 
consumer processes to which this consumer belongs. By setting the  [...]
     "groupInstanceId": { "index": 33, "kind": "parameter", "displayName": 
"Group Instance Id", "group": "consumer", "label": "consumer", "required": 
false, "type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "A unique identifier of the consumer instance 
provided by the end user. Only non-empty strings ar [...]
     "groupProtocol": { "index": 34, "kind": "parameter", "displayName": "Group 
Protocol", "group": "consumer", "label": "consumer", "required": false, "type": 
"enum", "javaType": "java.lang.String", "enum": [ "classic", "consumer" ], 
"deprecated": false, "autowired": false, "secret": false, "defaultValue": 
"classic", "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The consumer group protocol to use. The c [...]
     "groupRemoteAssignor": { "index": 35, "kind": "parameter", "displayName": 
"Group Remote Assignor", "group": "consumer", "label": "consumer", "required": 
false, "type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The name of the server-side assignor to use 
when group.protocol is set to consumer. If n [...]
diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/kafka-component.adoc
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/kafka-component.adoc
index ce5776684c47..a3888f3f230f 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/kafka-component.adoc
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/kafka-component.adoc
@@ -260,7 +260,7 @@ Lastly, it is also possible to do so in a processor:
 ._Java-only: processor for header type conversion_
 [source,java]
 ----
-from("kafka:my-topic")
+from("kafka:my-topic?groupId=my-group")
     .process(exchange -> {
         byte[] id = exchange.getIn().getHeader("id", byte[].class);
         BigInteger bi = new BigInteger(id);
@@ -356,6 +356,28 @@ NOTE: A synchronous commit must be called by the consumer 
thread. Certain EIPs,
 for example, the Aggregate EIP completes its groups on its own `Aggregator` 
thread. A synchronous commit on such a thread makes the Kafka client throw
 a `java.util.ConcurrentModificationException` with the message `KafkaConsumer 
is not safe for multi-threaded access`. Use the asynchronous commit there 
instead.
 
+=== Consumer groups
+
+The `groupId` option sets the Kafka consumer group of the consumer. The 
consumers of a group share the partitions of
+the topic, so each record is processed by one of them. The group keeps the 
committed offsets: after a restart, a
+consumer resumes where the group stopped.
+
+The group can also be set with the `group.id` Kafka property in 
`additionalProperties`
+(`additionalProperties.group.id=my-group` on the endpoint, or 
`camel.component.kafka.additional-properties[group.id]`
+on the component). When both `groupId` and the `group.id` property are set, 
`groupId` is used. A `group.id` set on the
+component applies to every consumer endpoint without `groupId`, so routes that 
consume the same topic share its
+records.
+
+Without either, the consumer uses a generated group id, a new one at each 
start, and logs a WARN when it starts:
+
+* After a restart the consumer does not resume from the offsets committed 
before. It starts where `autoOffsetReset`
+  says: with the default `latest`, the records sent while the application was 
stopped are not consumed.
+* Each instance of the application (for example each replica of a deployment) 
is a group of its own, and receives every
+  record.
+
+This only suits a consumer that must receive every record in each instance, 
from the time it starts. Set `groupId` on
+the other consumers.
+
 === Where a new consumer group starts reading
 
 The `autoOffsetReset` option controls where a Kafka consumer group begins 
reading when it has *no previously committed offset* for the topic partition, 
or when the committed offset is no longer available on the broker (e.g. it has 
been deleted by retention).
@@ -407,7 +429,7 @@ conditions external to the component itself, such as an 
external system being un
 ._Java-only: pausable consumer with lambda_
 [source,java]
 ----
-from("kafka:topic")
+from("kafka:topic?groupId=my-group")
     .pausable(new KafkaConsumerListener(), () -> canContinue())
     .routeId("pausable-route")
     .process(this::process)
@@ -1488,7 +1510,8 @@ NOTE: the downside of this approach is an increased 
number of in-flight exchange
 
 === Consuming messages from Kafka
 
-Here is the minimal route you need to read messages from Kafka.
+Here is the minimal route you need to read messages from Kafka. Set `groupId` 
so that the consumer resumes from its
+committed offsets after a restart (see <<_consumer_groups,Consumer groups>>).
 
 [tabs]
 ====
@@ -1496,7 +1519,7 @@ Java::
 +
 [source,java]
 ----
-from("kafka:test?brokers=localhost:9092")
+from("kafka:test?brokers=localhost:9092&groupId=my-group")
     .log("Message received from Kafka : ${body}")
     .log("    on the topic ${headers[CamelKafkaTopic]}")
     .log("    on the partition ${headers[CamelKafkaPartition]}")
@@ -1509,7 +1532,7 @@ XML::
 [source,xml]
 ----
 <route>
-  <from uri="kafka:test?brokers=localhost:9092"/>
+  <from uri="kafka:test?brokers=localhost:9092&amp;groupId=my-group"/>
   <log message="Message received from Kafka : ${body}"/>
   <log message="    on the topic ${headers[CamelKafkaTopic]}"/>
   <log message="    on the partition ${headers[CamelKafkaPartition]}"/>
@@ -1527,6 +1550,7 @@ YAML::
       uri: kafka:test
       parameters:
         brokers: "localhost:9092"
+        groupId: my-group
       steps:
         - log: "Message received from Kafka : ${body}"
         - log: "    on the topic ${headers[CamelKafkaTopic]}"
@@ -1544,7 +1568,7 @@ Java::
 +
 [source,java]
 ----
-from("kafka:test,test1,test2?brokers=localhost:9092")
+from("kafka:test,test1,test2?brokers=localhost:9092&groupId=my-group")
     .log("Message received from Kafka : ${body}")
     .log("    on the topic ${headers[CamelKafkaTopic]}")
     .log("    on the partition ${headers[CamelKafkaPartition]}")
@@ -1557,7 +1581,7 @@ XML::
 [source,xml]
 ----
 <route>
-  <from uri="kafka:test,test1,test2?brokers=localhost:9092"/>
+  <from 
uri="kafka:test,test1,test2?brokers=localhost:9092&amp;groupId=my-group"/>
   <log message="Message received from Kafka : ${body}"/>
   <log message="    on the topic ${headers[CamelKafkaTopic]}"/>
   <log message="    on the partition ${headers[CamelKafkaPartition]}"/>
@@ -1575,6 +1599,7 @@ YAML::
       uri: "kafka:test,test1,test2"
       parameters:
         brokers: "localhost:9092"
+        groupId: my-group
       steps:
         - log: "Message received from Kafka : ${body}"
         - log: "    on the topic ${headers[CamelKafkaTopic]}"
@@ -1592,7 +1617,7 @@ Java::
 +
 [source,java]
 ----
-from("kafka:test.*?brokers=localhost:9092&topicIsPattern=true")
+from("kafka:test.*?brokers=localhost:9092&groupId=my-group&topicIsPattern=true")
     .log("Message received from Kafka : ${body}")
     .log("    on the topic ${headers[CamelKafkaTopic]}")
     .log("    on the partition ${headers[CamelKafkaPartition]}")
@@ -1605,7 +1630,7 @@ XML::
 [source,xml]
 ----
 <route>
-  <from uri="kafka:test.*?brokers=localhost:9092&amp;topicIsPattern=true"/>
+  <from 
uri="kafka:test.*?brokers=localhost:9092&amp;groupId=my-group&amp;topicIsPattern=true"/>
   <log message="Message received from Kafka : ${body}"/>
   <log message="    on the topic ${headers[CamelKafkaTopic]}"/>
   <log message="    on the partition ${headers[CamelKafkaPartition]}"/>
@@ -1623,6 +1648,7 @@ YAML::
       uri: "kafka:test.*"
       parameters:
         brokers: "localhost:9092"
+        groupId: my-group
         topicIsPattern: true
       steps:
         - log: "Message received from Kafka : ${body}"
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 d051d1c23d53..1a9e7f4c66ef 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
@@ -57,7 +57,7 @@
     "fetchMaxBytes": { "index": 30, "kind": "property", "displayName": "Fetch 
Max Bytes", "group": "consumer", "label": "consumer", "required": false, 
"type": "integer", "javaType": "java.lang.Integer", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": 52428800, 
"configurationClass": "org.apache.camel.component.kafka.KafkaConfiguration", 
"configurationField": "configuration", "description": "The maximum amount of 
data the server should return for a fetch request.  [...]
     "fetchMinBytes": { "index": 31, "kind": "property", "displayName": "Fetch 
Min Bytes", "group": "consumer", "label": "consumer", "required": false, 
"type": "integer", "javaType": "java.lang.Integer", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": 1, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The minimum amount of data the server should 
return for a fetch request. If insu [...]
     "fetchWaitMaxMs": { "index": 32, "kind": "property", "displayName": "Fetch 
Wait Max Ms", "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 amount of time the server will 
block before answering the fetch [...]
-    "groupId": { "index": 33, "kind": "property", "displayName": "Group Id", 
"group": "consumer", "label": "consumer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "A string that uniquely identifies the group of 
consumer processes to which this consumer belongs. By setting the s [...]
+    "groupId": { "index": 33, "kind": "property", "displayName": "Group Id", 
"group": "consumer", "label": "consumer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "A string that uniquely identifies the group of 
consumer processes to which this consumer belongs. By setting the s [...]
     "groupInstanceId": { "index": 34, "kind": "property", "displayName": 
"Group Instance Id", "group": "consumer", "label": "consumer", "required": 
false, "type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "A unique identifier of the consumer instance 
provided by the end user. Only non-empty strings are [...]
     "groupProtocol": { "index": 35, "kind": "property", "displayName": "Group 
Protocol", "group": "consumer", "label": "consumer", "required": false, "type": 
"enum", "javaType": "java.lang.String", "enum": [ "classic", "consumer" ], 
"deprecated": false, "autowired": false, "secret": false, "defaultValue": 
"classic", "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The consumer group protocol to use. The cl 
[...]
     "groupRemoteAssignor": { "index": 36, "kind": "property", "displayName": 
"Group Remote Assignor", "group": "consumer", "label": "consumer", "required": 
false, "type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The name of the server-side assignor to use 
when group.protocol is set to consumer. If no [...]
@@ -209,7 +209,7 @@
     "fetchMaxBytes": { "index": 29, "kind": "parameter", "displayName": "Fetch 
Max Bytes", "group": "consumer", "label": "consumer", "required": false, 
"type": "integer", "javaType": "java.lang.Integer", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": 52428800, 
"configurationClass": "org.apache.camel.component.kafka.KafkaConfiguration", 
"configurationField": "configuration", "description": "The maximum amount of 
data the server should return for a fetch request. [...]
     "fetchMinBytes": { "index": 30, "kind": "parameter", "displayName": "Fetch 
Min Bytes", "group": "consumer", "label": "consumer", "required": false, 
"type": "integer", "javaType": "java.lang.Integer", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": 1, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The minimum amount of data the server should 
return for a fetch request. If ins [...]
     "fetchWaitMaxMs": { "index": 31, "kind": "parameter", "displayName": 
"Fetch Wait Max Ms", "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 amount of time the server will 
block before answering the fetc [...]
-    "groupId": { "index": 32, "kind": "parameter", "displayName": "Group Id", 
"group": "consumer", "label": "consumer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "A string that uniquely identifies the group of 
consumer processes to which this consumer belongs. By setting the  [...]
+    "groupId": { "index": 32, "kind": "parameter", "displayName": "Group Id", 
"group": "consumer", "label": "consumer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "A string that uniquely identifies the group of 
consumer processes to which this consumer belongs. By setting the  [...]
     "groupInstanceId": { "index": 33, "kind": "parameter", "displayName": 
"Group Instance Id", "group": "consumer", "label": "consumer", "required": 
false, "type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "A unique identifier of the consumer instance 
provided by the end user. Only non-empty strings ar [...]
     "groupProtocol": { "index": 34, "kind": "parameter", "displayName": "Group 
Protocol", "group": "consumer", "label": "consumer", "required": false, "type": 
"enum", "javaType": "java.lang.String", "enum": [ "classic", "consumer" ], 
"deprecated": false, "autowired": false, "secret": false, "defaultValue": 
"classic", "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The consumer group protocol to use. The c [...]
     "groupRemoteAssignor": { "index": 35, "kind": "parameter", "displayName": 
"Group Remote Assignor", "group": "consumer", "label": "consumer", "required": 
false, "type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField": 
"configuration", "description": "The name of the server-side assignor to use 
when group.protocol is set to consumer. If n [...]
diff --git a/components/camel-kafka/src/main/docs/kafka-component.adoc 
b/components/camel-kafka/src/main/docs/kafka-component.adoc
index ce5776684c47..a3888f3f230f 100644
--- a/components/camel-kafka/src/main/docs/kafka-component.adoc
+++ b/components/camel-kafka/src/main/docs/kafka-component.adoc
@@ -260,7 +260,7 @@ Lastly, it is also possible to do so in a processor:
 ._Java-only: processor for header type conversion_
 [source,java]
 ----
-from("kafka:my-topic")
+from("kafka:my-topic?groupId=my-group")
     .process(exchange -> {
         byte[] id = exchange.getIn().getHeader("id", byte[].class);
         BigInteger bi = new BigInteger(id);
@@ -356,6 +356,28 @@ NOTE: A synchronous commit must be called by the consumer 
thread. Certain EIPs,
 for example, the Aggregate EIP completes its groups on its own `Aggregator` 
thread. A synchronous commit on such a thread makes the Kafka client throw
 a `java.util.ConcurrentModificationException` with the message `KafkaConsumer 
is not safe for multi-threaded access`. Use the asynchronous commit there 
instead.
 
+=== Consumer groups
+
+The `groupId` option sets the Kafka consumer group of the consumer. The 
consumers of a group share the partitions of
+the topic, so each record is processed by one of them. The group keeps the 
committed offsets: after a restart, a
+consumer resumes where the group stopped.
+
+The group can also be set with the `group.id` Kafka property in 
`additionalProperties`
+(`additionalProperties.group.id=my-group` on the endpoint, or 
`camel.component.kafka.additional-properties[group.id]`
+on the component). When both `groupId` and the `group.id` property are set, 
`groupId` is used. A `group.id` set on the
+component applies to every consumer endpoint without `groupId`, so routes that 
consume the same topic share its
+records.
+
+Without either, the consumer uses a generated group id, a new one at each 
start, and logs a WARN when it starts:
+
+* After a restart the consumer does not resume from the offsets committed 
before. It starts where `autoOffsetReset`
+  says: with the default `latest`, the records sent while the application was 
stopped are not consumed.
+* Each instance of the application (for example each replica of a deployment) 
is a group of its own, and receives every
+  record.
+
+This only suits a consumer that must receive every record in each instance, 
from the time it starts. Set `groupId` on
+the other consumers.
+
 === Where a new consumer group starts reading
 
 The `autoOffsetReset` option controls where a Kafka consumer group begins 
reading when it has *no previously committed offset* for the topic partition, 
or when the committed offset is no longer available on the broker (e.g. it has 
been deleted by retention).
@@ -407,7 +429,7 @@ conditions external to the component itself, such as an 
external system being un
 ._Java-only: pausable consumer with lambda_
 [source,java]
 ----
-from("kafka:topic")
+from("kafka:topic?groupId=my-group")
     .pausable(new KafkaConsumerListener(), () -> canContinue())
     .routeId("pausable-route")
     .process(this::process)
@@ -1488,7 +1510,8 @@ NOTE: the downside of this approach is an increased 
number of in-flight exchange
 
 === Consuming messages from Kafka
 
-Here is the minimal route you need to read messages from Kafka.
+Here is the minimal route you need to read messages from Kafka. Set `groupId` 
so that the consumer resumes from its
+committed offsets after a restart (see <<_consumer_groups,Consumer groups>>).
 
 [tabs]
 ====
@@ -1496,7 +1519,7 @@ Java::
 +
 [source,java]
 ----
-from("kafka:test?brokers=localhost:9092")
+from("kafka:test?brokers=localhost:9092&groupId=my-group")
     .log("Message received from Kafka : ${body}")
     .log("    on the topic ${headers[CamelKafkaTopic]}")
     .log("    on the partition ${headers[CamelKafkaPartition]}")
@@ -1509,7 +1532,7 @@ XML::
 [source,xml]
 ----
 <route>
-  <from uri="kafka:test?brokers=localhost:9092"/>
+  <from uri="kafka:test?brokers=localhost:9092&amp;groupId=my-group"/>
   <log message="Message received from Kafka : ${body}"/>
   <log message="    on the topic ${headers[CamelKafkaTopic]}"/>
   <log message="    on the partition ${headers[CamelKafkaPartition]}"/>
@@ -1527,6 +1550,7 @@ YAML::
       uri: kafka:test
       parameters:
         brokers: "localhost:9092"
+        groupId: my-group
       steps:
         - log: "Message received from Kafka : ${body}"
         - log: "    on the topic ${headers[CamelKafkaTopic]}"
@@ -1544,7 +1568,7 @@ Java::
 +
 [source,java]
 ----
-from("kafka:test,test1,test2?brokers=localhost:9092")
+from("kafka:test,test1,test2?brokers=localhost:9092&groupId=my-group")
     .log("Message received from Kafka : ${body}")
     .log("    on the topic ${headers[CamelKafkaTopic]}")
     .log("    on the partition ${headers[CamelKafkaPartition]}")
@@ -1557,7 +1581,7 @@ XML::
 [source,xml]
 ----
 <route>
-  <from uri="kafka:test,test1,test2?brokers=localhost:9092"/>
+  <from 
uri="kafka:test,test1,test2?brokers=localhost:9092&amp;groupId=my-group"/>
   <log message="Message received from Kafka : ${body}"/>
   <log message="    on the topic ${headers[CamelKafkaTopic]}"/>
   <log message="    on the partition ${headers[CamelKafkaPartition]}"/>
@@ -1575,6 +1599,7 @@ YAML::
       uri: "kafka:test,test1,test2"
       parameters:
         brokers: "localhost:9092"
+        groupId: my-group
       steps:
         - log: "Message received from Kafka : ${body}"
         - log: "    on the topic ${headers[CamelKafkaTopic]}"
@@ -1592,7 +1617,7 @@ Java::
 +
 [source,java]
 ----
-from("kafka:test.*?brokers=localhost:9092&topicIsPattern=true")
+from("kafka:test.*?brokers=localhost:9092&groupId=my-group&topicIsPattern=true")
     .log("Message received from Kafka : ${body}")
     .log("    on the topic ${headers[CamelKafkaTopic]}")
     .log("    on the partition ${headers[CamelKafkaPartition]}")
@@ -1605,7 +1630,7 @@ XML::
 [source,xml]
 ----
 <route>
-  <from uri="kafka:test.*?brokers=localhost:9092&amp;topicIsPattern=true"/>
+  <from 
uri="kafka:test.*?brokers=localhost:9092&amp;groupId=my-group&amp;topicIsPattern=true"/>
   <log message="Message received from Kafka : ${body}"/>
   <log message="    on the topic ${headers[CamelKafkaTopic]}"/>
   <log message="    on the partition ${headers[CamelKafkaPartition]}"/>
@@ -1623,6 +1648,7 @@ YAML::
       uri: "kafka:test.*"
       parameters:
         brokers: "localhost:9092"
+        groupId: my-group
         topicIsPattern: true
       steps:
         - log: "Message received from Kafka : ${body}"
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 01ea2624132a..f18689ccdcb7 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
@@ -311,8 +311,11 @@ public class KafkaConfiguration extends 
KafkaClientConfiguration {
 
     /**
      * A string that uniquely identifies the group of consumer processes to 
which this consumer belongs. By setting the
-     * same group id, multiple processes can indicate that they are all part 
of the same consumer group. This option is
-     * required for consumers.
+     * same group id, multiple processes can indicate that they are all part 
of the same consumer group. It takes
+     * precedence over a group.id set in additionalProperties. If neither is 
set, the consumer uses a generated group
+     * id, a new one at each start, and logs a WARN: it does not resume from 
the offsets committed before a restart, and
+     * each instance of the application receives every record. Set it on a 
consumer that must resume after a restart or
+     * share the records with other instances.
      */
     public void setGroupId(String groupId) {
         this.groupId = groupId;
diff --git 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java
 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java
index 053105724cad..ab8c264c3c82 100644
--- 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java
+++ 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java
@@ -19,6 +19,7 @@ package org.apache.camel.component.kafka;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
+import java.util.Map;
 import java.util.Properties;
 import java.util.UUID;
 import java.util.concurrent.ExecutorService;
@@ -114,8 +115,8 @@ public class KafkaConsumer extends DefaultConsumer
         
ObjectHelper.ifNotEmpty(endpoint.getKafkaClientFactory().getBrokers(configuration),
                 v -> props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, v));
 
-        String groupId = configuration.getGroupId() != null ? 
configuration.getGroupId() : defaultGroupId;
-        props.put(ConsumerConfig.GROUP_ID_CONFIG, groupId);
+        String groupId = configuredGroupId();
+        props.put(ConsumerConfig.GROUP_ID_CONFIG, groupId != null ? groupId : 
defaultGroupId);
 
         ObjectHelper.ifNotEmpty(configuration.getGroupInstanceId(),
                 v -> props.put(ConsumerConfig.GROUP_INSTANCE_ID_CONFIG, v));
@@ -130,12 +131,33 @@ public class KafkaConsumer extends DefaultConsumer
         return props;
     }
 
+    /**
+     * The consumer group set by the groupId option or, without it, by the 
group.id additional property. Null when
+     * neither sets one: the consumer then uses a generated group id.
+     */
+    private String configuredGroupId() {
+        KafkaConfiguration configuration = endpoint.getConfiguration();
+        if (configuration.getGroupId() != null) {
+            return configuration.getGroupId();
+        }
+        Map<String, Object> additionalProperties = 
configuration.getAdditionalProperties();
+        Object groupId = additionalProperties != null ? 
additionalProperties.get(ConsumerConfig.GROUP_ID_CONFIG) : null;
+        return ObjectHelper.isNotEmpty(groupId) ? groupId.toString() : null;
+    }
+
     @Override
     protected void doStart() throws Exception {
         validateExactlyOnceConfiguration();
 
         LOG.info("Starting Kafka consumer on topic: {} with breakOnFirstError: 
{}", endpoint.getConfiguration().getTopic(),
                 endpoint.getConfiguration().isBreakOnFirstError());
+        if (configuredGroupId() == null) {
+            LOG.warn("Kafka consumer on topic: {} has no groupId and uses the 
generated consumer group {}, a new one at each"
+                     + " start. It does not resume from the offsets committed 
before a restart, and each instance of the"
+                     + " application receives every record instead of sharing 
them with the others. Set the groupId"
+                     + " option to use a stable consumer group.",
+                    endpoint.getConfiguration().getTopic(), defaultGroupId);
+        }
         super.doStart();
         if (endpoint.getConfiguration().isExactlyOnce()) {
             
KafkaRecordStreamingProcessorFacade.validateNoKafkaWireTaps(endpoint.getCamelContext(),
 getRouteId());
diff --git 
a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaConsumerGroupIdTest.java
 
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaConsumerGroupIdTest.java
new file mode 100644
index 000000000000..7969bc7a8e98
--- /dev/null
+++ 
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaConsumerGroupIdTest.java
@@ -0,0 +1,249 @@
+/*
+ * 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;
+
+import java.time.Duration;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.UUID;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.kafka.clients.consumer.Consumer;
+import org.apache.kafka.clients.consumer.ConsumerConfig;
+import org.apache.kafka.clients.consumer.ConsumerRecords;
+import org.apache.kafka.clients.consumer.MockConsumer;
+import org.apache.kafka.clients.producer.Producer;
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.Logger;
+import org.apache.logging.log4j.core.appender.AbstractAppender;
+import org.apache.logging.log4j.core.config.Property;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.awaitility.Awaitility.await;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+/**
+ * The consumer group of a Kafka consumer. The groupId option sets it, or else 
the group.id additional property. Without
+ * either, the consumer uses a generated group id, a new one at each start of 
the application, and logs a WARN that says
+ * so. A {@link KafkaClientFactory} records the properties of each Kafka 
consumer instead of connecting to a broker, and
+ * each start of the application is a new CamelContext.
+ */
+class KafkaConsumerGroupIdTest {
+
+    private final String topic = "group-id-" + UUID.randomUUID();
+    private final List<Properties> consumerProps = new 
CopyOnWriteArrayList<>();
+    private final List<String> warnings = new CopyOnWriteArrayList<>();
+    private final Logger logger = (Logger) 
LogManager.getLogger(KafkaConsumer.class);
+    private final AbstractAppender appender
+            = new AbstractAppender("KafkaConsumerGroupIdTest", null, null, 
true, Property.EMPTY_ARRAY) {
+                @Override
+                public void append(LogEvent event) {
+                    String message = event.getMessage().getFormattedMessage();
+                    // only the events of the consumers of this test, as other 
tests may run at the same time
+                    if (event.getLevel().isMoreSpecificThan(Level.WARN) && 
message.contains(topic)) {
+                        warnings.add(message);
+                    }
+                }
+            };
+
+    @BeforeEach
+    void captureWarnings() {
+        appender.start();
+        logger.addAppender(appender);
+    }
+
+    @AfterEach
+    void stopCapture() {
+        logger.removeAppender(appender);
+        appender.stop();
+    }
+
+    @Test
+    void withoutGroupIdEachStartUsesANewGeneratedGroupAndWarns() throws 
Exception {
+        String uri = "kafka:" + topic + 
"?brokers=localhost:9092&kafkaClientFactory=#recordingFactory";
+
+        String first = startAndStopApplication(uri, 1).get(0);
+        String second = startAndStopApplication(uri, 1).get(0);
+
+        assertDoesNotThrow(() -> UUID.fromString(first));
+        assertDoesNotThrow(() -> UUID.fromString(second));
+        assertNotEquals(first, second);
+
+        assertEquals(2, warnings.size(), "one warning at each start: " + 
warnings);
+        assertWarnsAbout(warnings.get(0), first);
+        assertWarnsAbout(warnings.get(1), second);
+    }
+
+    @Test
+    void 
withoutGroupIdTheConsumersOfTheEndpointShareTheGeneratedGroupAndWarnOnce() 
throws Exception {
+        String uri = "kafka:" + topic + 
"?brokers=localhost:9092&kafkaClientFactory=#recordingFactory&consumersCount=3";
+
+        List<String> groups = startAndStopApplication(uri, 3);
+
+        assertEquals(List.of(groups.get(0), groups.get(0), groups.get(0)), 
groups);
+        assertEquals(1, warnings.size(), "one warning for the endpoint: " + 
warnings);
+        assertWarnsAbout(warnings.get(0), groups.get(0));
+    }
+
+    @Test
+    void withGroupIdEachStartUsesTheGroupWithoutWarning() throws Exception {
+        String uri = "kafka:" + topic + 
"?brokers=localhost:9092&kafkaClientFactory=#recordingFactory&groupId=orders";
+
+        assertEquals(List.of("orders"), startAndStopApplication(uri, 1));
+        assertEquals(List.of("orders"), startAndStopApplication(uri, 1));
+
+        assertEquals(List.of(), warnings);
+    }
+
+    @Test
+    void 
withGroupIdInAdditionalPropertiesEachStartUsesThatGroupWithoutWarning() throws 
Exception {
+        String uri = "kafka:" + topic
+                     + 
"?brokers=localhost:9092&kafkaClientFactory=#recordingFactory&additionalProperties.group.id=orders";
+
+        assertEquals(List.of("orders"), startAndStopApplication(uri, 1));
+        assertEquals(List.of("orders"), startAndStopApplication(uri, 1));
+
+        assertEquals(List.of(), warnings);
+    }
+
+    @Test
+    void 
withGroupIdInTheAdditionalPropertiesOfTheComponentTheConsumersUseThatGroupWithoutWarning()
 throws Exception {
+        String uri = "kafka:" + topic + 
"?brokers=localhost:9092&kafkaClientFactory=#recordingFactory&consumersCount=2";
+
+        assertEquals(List.of("orders", "orders"),
+                startAndStopApplication(uri, 2, 
Map.of(ConsumerConfig.GROUP_ID_CONFIG, "orders")));
+
+        assertEquals(List.of(), warnings);
+    }
+
+    @Test
+    void theGroupIdOptionTakesPrecedenceOverTheGroupIdInAdditionalProperties() 
throws Exception {
+        String uri = "kafka:" + topic + 
"?brokers=localhost:9092&kafkaClientFactory=#recordingFactory&groupId=orders"
+                     + "&additionalProperties.group.id=invoices";
+
+        assertEquals(List.of("orders"), startAndStopApplication(uri, 1));
+
+        assertEquals(List.of(), warnings);
+    }
+
+    @Test
+    void 
withABlankGroupIdInAdditionalPropertiesTheConsumerUsesAGeneratedGroupAndWarns() 
throws Exception {
+        String uri = "kafka:" + topic + 
"?brokers=localhost:9092&kafkaClientFactory=#recordingFactory";
+
+        String group = startAndStopApplication(uri, 1, 
Map.of(ConsumerConfig.GROUP_ID_CONFIG, " ")).get(0);
+
+        assertDoesNotThrow(() -> UUID.fromString(group));
+        assertEquals(1, warnings.size(), "one warning at the start: " + 
warnings);
+        assertWarnsAbout(warnings.get(0), group);
+    }
+
+    private static void assertWarnsAbout(String warning, String group) {
+        assertTrue(warning.contains(group), "the warning names the generated 
group " + group + ": " + warning);
+        assertTrue(warning.contains("groupId"), "the warning names the groupId 
option: " + warning);
+    }
+
+    /**
+     * Starts a CamelContext with a route from the given uri, waits for its 
Kafka consumers and stops it.
+     *
+     * @return the group.id of each Kafka consumer of the route
+     */
+    private List<String> startAndStopApplication(String uri, int consumers) 
throws Exception {
+        return startAndStopApplication(uri, consumers, Map.of());
+    }
+
+    /**
+     * Same as {@link #startAndStopApplication(String, int)}, with the given 
additional properties on the Kafka
+     * component, as set with camel.component.kafka.additional-properties.
+     */
+    private List<String> startAndStopApplication(String uri, int consumers, 
Map<String, Object> componentAdditionalProperties)
+            throws Exception {
+        int before = consumerProps.size();
+        try (DefaultCamelContext context = new DefaultCamelContext()) {
+            context.getRegistry().bind("recordingFactory", new 
RecordingFactory());
+            context.getComponent("kafka", 
KafkaComponent.class).getConfiguration()
+                    
.getAdditionalProperties().putAll(componentAdditionalProperties);
+            context.addRoutes(new RouteBuilder() {
+                @Override
+                public void configure() {
+                    from(uri).routeId("kafka").to("mock:result");
+                }
+            });
+            context.start();
+            await().atMost(20, TimeUnit.SECONDS).until(() -> 
consumerProps.size() == before + consumers);
+            context.stop();
+        }
+        return consumerProps.subList(before, before + consumers).stream()
+                .map(props -> 
props.getProperty(ConsumerConfig.GROUP_ID_CONFIG))
+                .toList();
+    }
+
+    private final class RecordingFactory implements KafkaClientFactory {
+        @Override
+        public Producer getProducer(Properties kafkaProps) {
+            throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public Consumer getConsumer(Properties kafkaProps) {
+            consumerProps.add(kafkaProps);
+            return new IdleConsumer();
+        }
+
+        @Override
+        public String getBrokers(KafkaConfiguration configuration) {
+            return "localhost:9092";
+        }
+    }
+
+    /**
+     * A consumer of an idle topic: a poll waits up to its timeout, unless the 
consumer is woken up.
+     */
+    private static final class IdleConsumer extends MockConsumer<Object, 
Object> {
+        private final CountDownLatch wokenUp = new CountDownLatch(1);
+
+        IdleConsumer() {
+            super("earliest");
+        }
+
+        @Override
+        public ConsumerRecords<Object, Object> poll(Duration timeout) {
+            try {
+                wokenUp.await(timeout.toMillis(), TimeUnit.MILLISECONDS);
+            } catch (InterruptedException e) {
+                Thread.currentThread().interrupt();
+            }
+            return ConsumerRecords.empty();
+        }
+
+        @Override
+        public void wakeup() {
+            wokenUp.countDown();
+        }
+    }
+}
diff --git 
a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc 
b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
index b449b993d228..72162d3f69a5 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
@@ -575,6 +575,25 @@ Before, all the consumers used the same id and fenced each 
other in a loop (`Fen
 `consumersCount=1` the id is used as given. After the upgrade, the static 
member with the old id stays in the group
 until its session timeout (`sessionTimeoutMs`) expires.
 
+=== camel-kafka - a consumer without groupId logs a WARN
+
+A Kafka consumer without `groupId` now logs a WARN when it starts. It still 
uses a generated consumer group id, a new
+one at each start: it does not resume from the offsets committed before a 
restart, and each instance of the application
+receives every record. Set `groupId` to use a stable consumer group. See the
+xref:components::kafka-component.adoc[Kafka component].
+
+=== camel-kafka - a consumer uses the group.id set in additionalProperties
+
+A Kafka consumer without `groupId` now uses the `group.id` set in 
`additionalProperties`
+(`additionalProperties.group.id` on the endpoint, or 
`camel.component.kafka.additional-properties[group.id]`).
+Before, the consumer replaced it with a generated group id, a new one at each 
start. Such a consumer now joins that
+group: it starts from the offsets committed by the group (or where 
`autoOffsetReset` says when the group has none), and
+the instances of the application that use the same group share the records. 
With `group.id` in the
+`additionalProperties` of the component, every consumer endpoint without 
`groupId` now joins that one group, where
+before each had a generated group of its own: routes that consume the same 
topic now share its records. Set `groupId`
+on each route that must receive every record. When both `groupId` and the 
`group.id` property are set, `groupId` is
+still used.
+
 === camel-jms, camel-sjms, camel-sjms2 - an exception sent back with 
transferException is not rolled back
 
 With `transferException=true`, a consumer that sends the exception of a failed 
exchange back as the reply now always
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 c9eefa22c592..7abc4aa3a72c 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
@@ -723,7 +723,13 @@ public interface KafkaComponentBuilderFactory {
          * A string that uniquely identifies the group of consumer processes to
          * which this consumer belongs. By setting the same group id, multiple
          * processes can indicate that they are all part of the same consumer
-         * group. This option is required for consumers.
+         * group. It takes precedence over a group.id set in
+         * additionalProperties. If neither is set, the consumer uses a
+         * generated group id, a new one at each start, and logs a WARN: it 
does
+         * not resume from the offsets committed before a restart, and each
+         * instance of the application receives every record. Set it on a
+         * consumer that must resume after a restart or share the records with
+         * other instances.
          * 
          * The option is a: &lt;code&gt;java.lang.String&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 8109ca697cbb..7602c297a8f4 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
@@ -1135,7 +1135,13 @@ public interface KafkaEndpointBuilderFactory {
          * A string that uniquely identifies the group of consumer processes to
          * which this consumer belongs. By setting the same group id, multiple
          * processes can indicate that they are all part of the same consumer
-         * group. This option is required for consumers.
+         * group. It takes precedence over a group.id set in
+         * additionalProperties. If neither is set, the consumer uses a
+         * generated group id, a new one at each start, and logs a WARN: it 
does
+         * not resume from the offsets committed before a restart, and each
+         * instance of the application receives every record. Set it on a
+         * consumer that must resume after a restart or share the records with
+         * other instances.
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 

Reply via email to