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 5127c6a691f6 CAMEL-27022: camel-kafka - with consumersCount greater
than 1, each consumer gets its own group instance id
5127c6a691f6 is described below
commit 5127c6a691f6e518f5aa66559513c5b7ce094db6
Author: croway <[email protected]>
AuthorDate: Mon Nov 16 10:05:55 2026 +0100
CAMEL-27022: camel-kafka - with consumersCount greater than 1, each
consumer gets its own group instance id
---
.../org/apache/camel/catalog/components/kafka.json | 8 +-
.../org/apache/camel/component/kafka/kafka.json | 8 +-
.../camel/component/kafka/KafkaConfiguration.java | 8 +-
.../camel/component/kafka/KafkaConsumer.java | 14 +-
.../kafka/KafkaConsumerGroupInstanceIdTest.java | 152 +++++++++++++++++++++
.../camel/component/kafka/KafkaConsumerTest.java | 6 +-
.../KafkaConsumerGroupInstanceIdIT.java | 96 +++++++++++++
.../ROOT/pages/camel-4x-upgrade-guide-4_24.adoc | 8 ++
.../dsl/KafkaComponentBuilderFactory.java | 10 +-
.../endpoint/dsl/KafkaEndpointBuilderFactory.java | 15 +-
10 files changed, 305 insertions(+), 20 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 4d1caa8173d4..df504340987d 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
@@ -53,12 +53,12 @@
"checkCrcs": { "index": 26, "kind": "property", "displayName": "Check
Crcs", "group": "consumer", "label": "consumer", "required": false, "type":
"boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": true, "configurationClass":
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField":
"configuration", "description": "Automatically check the CRC32 of the records
consumed. This ensures no on-the-wire or [...]
"commitTimeoutMs": { "index": 27, "kind": "property", "displayName":
"Commit Timeout Ms", "group": "consumer", "label": "consumer", "required":
false, "type": "duration", "javaType": "java.lang.Long", "deprecated": false,
"autowired": false, "secret": false, "defaultValue": "5000",
"configurationClass": "org.apache.camel.component.kafka.KafkaConfiguration",
"configurationField": "configuration", "description": "The maximum time, in
milliseconds, that the code will wait for a synchron [...]
"consumerRequestTimeoutMs": { "index": 28, "kind": "property",
"displayName": "Consumer Request Timeout Ms", "group": "consumer", "label":
"consumer", "required": false, "type": "integer", "javaType":
"java.lang.Integer", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": 30000, "configurationClass":
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField":
"configuration", "description": "The configuration controls the maximum amount
of time [...]
- "consumersCount": { "index": 29, "kind": "property", "displayName":
"Consumers Count", "group": "consumer", "label": "consumer", "required": false,
"type": "integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": 1, "configurationClass":
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField":
"configuration", "description": "The number of consumers that connect to kafka
server. Each consumer is run on a separate thre [...]
+ "consumersCount": { "index": 29, "kind": "property", "displayName":
"Consumers Count", "group": "consumer", "label": "consumer", "required": false,
"type": "integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": 1, "configurationClass":
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField":
"configuration", "description": "The number of consumers that connect to kafka
server. Each consumer is run on a separate thre [...]
"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 [...]
- "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 [...]
+ "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 [...]
"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
[...]
@@ -205,12 +205,12 @@
"checkCrcs": { "index": 25, "kind": "parameter", "displayName": "Check
Crcs", "group": "consumer", "label": "consumer", "required": false, "type":
"boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": true, "configurationClass":
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField":
"configuration", "description": "Automatically check the CRC32 of the records
consumed. This ensures no on-the-wire or [...]
"commitTimeoutMs": { "index": 26, "kind": "parameter", "displayName":
"Commit Timeout Ms", "group": "consumer", "label": "consumer", "required":
false, "type": "duration", "javaType": "java.lang.Long", "deprecated": false,
"autowired": false, "secret": false, "defaultValue": "5000",
"configurationClass": "org.apache.camel.component.kafka.KafkaConfiguration",
"configurationField": "configuration", "description": "The maximum time, in
milliseconds, that the code will wait for a synchro [...]
"consumerRequestTimeoutMs": { "index": 27, "kind": "parameter",
"displayName": "Consumer Request Timeout Ms", "group": "consumer", "label":
"consumer", "required": false, "type": "integer", "javaType":
"java.lang.Integer", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": 30000, "configurationClass":
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField":
"configuration", "description": "The configuration controls the maximum amount
of tim [...]
- "consumersCount": { "index": 28, "kind": "parameter", "displayName":
"Consumers Count", "group": "consumer", "label": "consumer", "required": false,
"type": "integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": 1, "configurationClass":
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField":
"configuration", "description": "The number of consumers that connect to kafka
server. Each consumer is run on a separate thr [...]
+ "consumersCount": { "index": 28, "kind": "parameter", "displayName":
"Consumers Count", "group": "consumer", "label": "consumer", "required": false,
"type": "integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": 1, "configurationClass":
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField":
"configuration", "description": "The number of consumers that connect to kafka
server. Each consumer is run on a separate thr [...]
"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 [...]
- "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 [...]
+ "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 [...]
"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
[...]
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 4d1caa8173d4..df504340987d 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
@@ -53,12 +53,12 @@
"checkCrcs": { "index": 26, "kind": "property", "displayName": "Check
Crcs", "group": "consumer", "label": "consumer", "required": false, "type":
"boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": true, "configurationClass":
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField":
"configuration", "description": "Automatically check the CRC32 of the records
consumed. This ensures no on-the-wire or [...]
"commitTimeoutMs": { "index": 27, "kind": "property", "displayName":
"Commit Timeout Ms", "group": "consumer", "label": "consumer", "required":
false, "type": "duration", "javaType": "java.lang.Long", "deprecated": false,
"autowired": false, "secret": false, "defaultValue": "5000",
"configurationClass": "org.apache.camel.component.kafka.KafkaConfiguration",
"configurationField": "configuration", "description": "The maximum time, in
milliseconds, that the code will wait for a synchron [...]
"consumerRequestTimeoutMs": { "index": 28, "kind": "property",
"displayName": "Consumer Request Timeout Ms", "group": "consumer", "label":
"consumer", "required": false, "type": "integer", "javaType":
"java.lang.Integer", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": 30000, "configurationClass":
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField":
"configuration", "description": "The configuration controls the maximum amount
of time [...]
- "consumersCount": { "index": 29, "kind": "property", "displayName":
"Consumers Count", "group": "consumer", "label": "consumer", "required": false,
"type": "integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": 1, "configurationClass":
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField":
"configuration", "description": "The number of consumers that connect to kafka
server. Each consumer is run on a separate thre [...]
+ "consumersCount": { "index": 29, "kind": "property", "displayName":
"Consumers Count", "group": "consumer", "label": "consumer", "required": false,
"type": "integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": 1, "configurationClass":
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField":
"configuration", "description": "The number of consumers that connect to kafka
server. Each consumer is run on a separate thre [...]
"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 [...]
- "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 [...]
+ "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 [...]
"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
[...]
@@ -205,12 +205,12 @@
"checkCrcs": { "index": 25, "kind": "parameter", "displayName": "Check
Crcs", "group": "consumer", "label": "consumer", "required": false, "type":
"boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": true, "configurationClass":
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField":
"configuration", "description": "Automatically check the CRC32 of the records
consumed. This ensures no on-the-wire or [...]
"commitTimeoutMs": { "index": 26, "kind": "parameter", "displayName":
"Commit Timeout Ms", "group": "consumer", "label": "consumer", "required":
false, "type": "duration", "javaType": "java.lang.Long", "deprecated": false,
"autowired": false, "secret": false, "defaultValue": "5000",
"configurationClass": "org.apache.camel.component.kafka.KafkaConfiguration",
"configurationField": "configuration", "description": "The maximum time, in
milliseconds, that the code will wait for a synchro [...]
"consumerRequestTimeoutMs": { "index": 27, "kind": "parameter",
"displayName": "Consumer Request Timeout Ms", "group": "consumer", "label":
"consumer", "required": false, "type": "integer", "javaType":
"java.lang.Integer", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": 30000, "configurationClass":
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField":
"configuration", "description": "The configuration controls the maximum amount
of tim [...]
- "consumersCount": { "index": 28, "kind": "parameter", "displayName":
"Consumers Count", "group": "consumer", "label": "consumer", "required": false,
"type": "integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": 1, "configurationClass":
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField":
"configuration", "description": "The number of consumers that connect to kafka
server. Each consumer is run on a separate thr [...]
+ "consumersCount": { "index": 28, "kind": "parameter", "displayName":
"Consumers Count", "group": "consumer", "label": "consumer", "required": false,
"type": "integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": 1, "configurationClass":
"org.apache.camel.component.kafka.KafkaConfiguration", "configurationField":
"configuration", "description": "The number of consumers that connect to kafka
server. Each consumer is run on a separate thr [...]
"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 [...]
- "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 [...]
+ "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 [...]
"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
[...]
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 6118d1fe32eb..01ea2624132a 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
@@ -327,7 +327,9 @@ public class KafkaConfiguration extends
KafkaClientConfiguration {
* set, the consumer is treated as a static member, which means that only
one instance with this ID is allowed in
* the consumer group at any time. This can be used in combination with a
larger session timeout to avoid group
* rebalances caused by transient unavailability (e.g., process restarts).
If not set, the consumer will join the
- * group as a dynamic member, which is the traditional behavior.
+ * group as a dynamic member, which is the traditional behavior. When
consumersCount is greater than 1, each
+ * consumer is a static member of its own, with this ID followed by a dash
and the index of the consumer (myId-0,
+ * myId-1, ...).
*/
public void setGroupInstanceId(String groupInstanceId) {
this.groupInstanceId = groupInstanceId;
@@ -375,7 +377,9 @@ public class KafkaConfiguration extends
KafkaClientConfiguration {
/**
* The number of consumers that connect to kafka server. Each consumer is
run on a separate thread that retrieves
- * and process the incoming data.
+ * and process the incoming data. Each consumer is a member of the
consumer group, so the consumers beyond the
+ * number of partitions of the topic (counting the consumers of all the
application instances) get no records. With
+ * groupInstanceId, each consumer gets its own group instance id.
*/
public void setConsumersCount(int consumersCount) {
this.consumersCount = consumersCount;
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 7af70b5bc0d4..053105724cad 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
@@ -102,7 +102,10 @@ public class KafkaConsumer extends DefaultConsumer
return (KafkaEndpoint) super.getEndpoint();
}
- Properties getProps() {
+ /**
+ * The properties of the Kafka consumer with the given index (0 to
consumersCount - 1).
+ */
+ Properties getProps(int consumerIndex) {
KafkaConfiguration configuration = endpoint.getConfiguration();
Properties props = configuration.createConsumerProperties();
@@ -117,6 +120,13 @@ public class KafkaConsumer extends DefaultConsumer
ObjectHelper.ifNotEmpty(configuration.getGroupInstanceId(),
v -> props.put(ConsumerConfig.GROUP_INSTANCE_ID_CONFIG, v));
+ // a group instance id is one static member of the group: the
consumers of the endpoint would fence each other
+ // with the same id, so each one gets the id followed by its index
+ Object groupInstanceId =
props.get(ConsumerConfig.GROUP_INSTANCE_ID_CONFIG);
+ if (configuration.getConsumersCount() > 1 &&
ObjectHelper.isNotEmpty(groupInstanceId)) {
+ props.put(ConsumerConfig.GROUP_INSTANCE_ID_CONFIG, groupInstanceId
+ "-" + consumerIndex);
+ }
+
return props;
}
@@ -180,7 +190,7 @@ public class KafkaConsumer extends DefaultConsumer
try {
for (int i = 0; i <
endpoint.getConfiguration().getConsumersCount(); i++) {
KafkaFetchRecords task = new KafkaFetchRecords(
- this, bridge, topic, pattern, Integer.toString(i),
getProps(), consumerListener);
+ this, bridge, topic, pattern, Integer.toString(i),
getProps(i), consumerListener);
// if camel has not been fully started yet then delay starting
this consumer to avoid
// process incoming message before camel is fully started
diff --git
a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaConsumerGroupInstanceIdTest.java
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaConsumerGroupInstanceIdTest.java
new file mode 100644
index 000000000000..cbd5fb52296f
--- /dev/null
+++
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaConsumerGroupInstanceIdTest.java
@@ -0,0 +1,152 @@
+/*
+ * 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.Properties;
+import java.util.Set;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
+
+import org.apache.camel.BindToRegistry;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.test.junit6.CamelTestSupport;
+import org.apache.camel.test.junit6.TestExecutionConfiguration;
+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.junit.jupiter.api.Test;
+
+import static org.awaitility.Awaitility.await;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+/**
+ * The group.instance.id of each Kafka consumer of an endpoint. A static
member id is allowed once in a consumer group,
+ * so with consumersCount greater than one each consumer gets its own id. A
{@link KafkaClientFactory} records the
+ * properties of each Kafka consumer instead of connecting to a broker.
+ */
+class KafkaConsumerGroupInstanceIdTest extends CamelTestSupport {
+
+ private final List<Properties> consumerProps = new
CopyOnWriteArrayList<>();
+
+ @BindToRegistry("recordingFactory")
+ private final KafkaClientFactory factory = new 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";
+ }
+ };
+
+ @Override
+ public void configureTest(TestExecutionConfiguration
testExecutionConfiguration) {
+ testExecutionConfiguration.withUseRouteBuilder(false);
+ }
+
+ @Test
+ void eachConsumerGetsItsOwnGroupInstanceId() throws Exception {
+ startRoute("&groupInstanceId=pod-1&consumersCount=3", 3);
+
+ assertEquals(Set.of("pod-1-0", "pod-1-1", "pod-1-2"),
groupInstanceIds());
+ }
+
+ @Test
+ void eachConsumerGetsItsOwnGroupInstanceIdFromAdditionalProperties()
throws Exception {
+
startRoute("&additionalProperties.group.instance.id=pod-1&consumersCount=2", 2);
+
+ assertEquals(Set.of("pod-1-0", "pod-1-1"), groupInstanceIds());
+ }
+
+ @Test
+ void oneConsumerKeepsTheGroupInstanceId() throws Exception {
+ startRoute("&groupInstanceId=pod-1", 1);
+
+ assertEquals("pod-1",
consumerProps.get(0).getProperty(ConsumerConfig.GROUP_INSTANCE_ID_CONFIG));
+ }
+
+ @Test
+ void dynamicMembersHaveNoGroupInstanceId() throws Exception {
+ startRoute("&consumersCount=3", 3);
+
+ for (Properties props : consumerProps) {
+
assertNull(props.getProperty(ConsumerConfig.GROUP_INSTANCE_ID_CONFIG));
+ }
+ }
+
+ private Set<String> groupInstanceIds() {
+ return consumerProps.stream()
+ .map(props ->
props.getProperty(ConsumerConfig.GROUP_INSTANCE_ID_CONFIG))
+ .collect(Collectors.toSet());
+ }
+
+ private void startRoute(String options, int consumers) throws Exception {
+ context.addRoutes(new RouteBuilder() {
+ @Override
+ public void configure() {
+
from("kafka:instances?brokers=localhost:9092&kafkaClientFactory=#recordingFactory&groupId=group"
+ + options)
+ .routeId("kafka")
+ .to("mock:result");
+ }
+ });
+ context.start();
+ await().atMost(20, TimeUnit.SECONDS).until(() -> consumerProps.size()
== consumers);
+ assertEquals(consumers, consumerProps.size());
+ }
+
+ /**
+ * 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/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaConsumerTest.java
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaConsumerTest.java
index 4f10f997f8ad..3ee7099e88ec 100644
---
a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaConsumerTest.java
+++
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaConsumerTest.java
@@ -58,7 +58,7 @@ public class KafkaConsumerTest {
when(clientFactory.getBrokers(any())).thenThrow(new
IllegalArgumentException());
final KafkaConsumer kafkaConsumer = new KafkaConsumer(endpoint,
processor);
- assertThrows(IllegalArgumentException.class, () ->
kafkaConsumer.getProps());
+ assertThrows(IllegalArgumentException.class, () ->
kafkaConsumer.getProps(0));
}
@Test
@@ -76,8 +76,8 @@ public class KafkaConsumerTest {
when(component.getKafkaClientFactory()).thenReturn(clientFactory);
final KafkaConsumer kafkaConsumer = new KafkaConsumer(endpoint,
processor);
- Properties props1 = kafkaConsumer.getProps();
- Properties props2 = kafkaConsumer.getProps();
+ Properties props1 = kafkaConsumer.getProps(0);
+ Properties props2 = kafkaConsumer.getProps(0);
String groupId1 = (String) props1.get(ConsumerConfig.GROUP_ID_CONFIG);
String groupId2 = (String) props2.get(ConsumerConfig.GROUP_ID_CONFIG);
diff --git
a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerGroupInstanceIdIT.java
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerGroupInstanceIdIT.java
new file mode 100644
index 000000000000..3963c3e581df
--- /dev/null
+++
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerGroupInstanceIdIT.java
@@ -0,0 +1,96 @@
+/*
+ * 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.List;
+import java.util.Optional;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
+
+import org.apache.camel.CamelContext;
+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.MemberDescription;
+import org.apache.kafka.clients.admin.NewTopic;
+import org.apache.kafka.clients.producer.KafkaProducer;
+import org.apache.kafka.clients.producer.ProducerRecord;
+import org.apache.kafka.common.Uuid;
+import org.junit.jupiter.api.Test;
+
+import static org.awaitility.Awaitility.await;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * Static membership with more than one consumer: each consumer joins the
group as its own static member, so the
+ * consumers do not fence each other, and the records of every partition are
consumed.
+ */
+class KafkaConsumerGroupInstanceIdIT extends BaseKafkaTestSupport {
+
+ private static final String TOPIC = "group-instance-id-" +
Uuid.randomUuid();
+ private static final String GROUP = TOPIC + "-group";
+ private static final int PARTITIONS = 3;
+
+ @Override
+ protected RouteBuilder createRouteBuilder() {
+ // the route is added by the test, once the topic has its partitions
+ return new RouteBuilder() {
+ @Override
+ public void configure() {
+ // no routes
+ }
+ };
+ }
+
+ @Test
+ void eachConsumerJoinsAsItsOwnStaticMember() throws Exception {
+ kafkaAdminClient.createTopics(List.of(new NewTopic(TOPIC, PARTITIONS,
(short) 1))).all().get(30, TimeUnit.SECONDS);
+
+ CamelContext context = contextExtension.getContext();
+ context.addRoutes(new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("kafka:" + TOPIC + "?groupId=" + GROUP +
"&groupInstanceId=camel&consumersCount=" + PARTITIONS
+ + "&autoOffsetReset=earliest&pollTimeoutMs=1000")
+ .routeId("static-members")
+ .to(KafkaTestUtil.MOCK_RESULT);
+ }
+ });
+
+ await().atMost(60, TimeUnit.SECONDS)
+ .untilAsserted(() -> assertEquals(Set.of("camel-0", "camel-1",
"camel-2"), groupInstanceIds()));
+
+ MockEndpoint result =
contextExtension.getMockEndpoint(KafkaTestUtil.MOCK_RESULT);
+ result.expectedBodiesReceivedInAnyOrder("record-0", "record-1",
"record-2");
+ try (KafkaProducer<String, String> producer = new
KafkaProducer<>(getDefaultProperties())) {
+ for (int partition = 0; partition < PARTITIONS; partition++) {
+ producer.send(new ProducerRecord<>(TOPIC, partition, null,
"record-" + partition)).get(30, TimeUnit.SECONDS);
+ }
+ }
+ MockEndpoint.assertIsSatisfied(context, 30, TimeUnit.SECONDS);
+ }
+
+ private Set<String> groupInstanceIds() throws Exception {
+ return
kafkaAdminClient.describeConsumerGroups(List.of(GROUP)).describedGroups().get(GROUP)
+ .get(10, TimeUnit.SECONDS)
+ .members().stream()
+ .map(MemberDescription::groupInstanceId)
+ .flatMap(Optional::stream)
+ .collect(Collectors.toSet());
+ }
+}
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 f846f815c0cf..3e9467ea04d0 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
@@ -441,6 +441,14 @@ consumer thread (for example, after an aggregator).
A commit called after the partition was revoked from the consumer is not made.
It would move back the offset that the new owner of the partition committed.
+=== camel-kafka - each consumer of consumersCount gets its own group instance
id
+
+With `groupInstanceId` (or `additionalProperties.group.instance.id`) and
`consumersCount` greater than 1, the consumer
+with index n now joins the group with the id `<groupInstanceId>-n`, for
example `pod-1-0`, `pod-1-1` and `pod-1-2`.
+Before, all the consumers used the same id and fenced each other in a loop
(`FencedInstanceIdException`). With
+`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-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 08e3c668b9fb..c9eefa22c592 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
@@ -639,7 +639,10 @@ public interface KafkaComponentBuilderFactory {
/**
* The number of consumers that connect to kafka server. Each consumer
* is run on a separate thread that retrieves and process the incoming
- * data.
+ * data. Each consumer is a member of the consumer group, so the
+ * consumers beyond the number of partitions of the topic (counting the
+ * consumers of all the application instances) get no records. With
+ * groupInstanceId, each consumer gets its own group instance id.
*
* The option is a: <code>int</code> type.
*
@@ -742,7 +745,10 @@ public interface KafkaComponentBuilderFactory {
* used in combination with a larger session timeout to avoid group
* rebalances caused by transient unavailability (e.g., process
* restarts). If not set, the consumer will join the group as a dynamic
- * member, which is the traditional behavior.
+ * member, which is the traditional behavior. When consumersCount is
+ * greater than 1, each consumer is a static member of its own, with
+ * this ID followed by a dash and the index of the consumer (myId-0,
+ * myId-1, ...).
*
* The option is a: <code>java.lang.String</code> 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 f9727eed0f6a..8109ca697cbb 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
@@ -979,7 +979,10 @@ public interface KafkaEndpointBuilderFactory {
/**
* The number of consumers that connect to kafka server. Each consumer
* is run on a separate thread that retrieves and process the incoming
- * data.
+ * data. Each consumer is a member of the consumer group, so the
+ * consumers beyond the number of partitions of the topic (counting the
+ * consumers of all the application instances) get no records. With
+ * groupInstanceId, each consumer gets its own group instance id.
*
* The option is a: <code>int</code> type.
*
@@ -996,7 +999,10 @@ public interface KafkaEndpointBuilderFactory {
/**
* The number of consumers that connect to kafka server. Each consumer
* is run on a separate thread that retrieves and process the incoming
- * data.
+ * data. Each consumer is a member of the consumer group, so the
+ * consumers beyond the number of partitions of the topic (counting the
+ * consumers of all the application instances) get no records. With
+ * groupInstanceId, each consumer gets its own group instance id.
*
* The option will be converted to a <code>int</code> type.
*
@@ -1150,7 +1156,10 @@ public interface KafkaEndpointBuilderFactory {
* used in combination with a larger session timeout to avoid group
* rebalances caused by transient unavailability (e.g., process
* restarts). If not set, the consumer will join the group as a dynamic
- * member, which is the traditional behavior.
+ * member, which is the traditional behavior. When consumersCount is
+ * greater than 1, each consumer is a static member of its own, with
+ * this ID followed by a dash and the index of the consumer (myId-0,
+ * myId-1, ...).
*
* The option is a: <code>java.lang.String</code> type.
*