Croway opened a new pull request, #30231: URL: https://github.com/apache/camel/pull/30231
JIRA: [CAMEL-27059](https://issues.apache.org/jira/browse/CAMEL-27059), [CAMEL-27075](https://issues.apache.org/jira/browse/CAMEL-27075) - A Kafka consumer without `groupId` uses a generated consumer group id, a new one at each start (the default since CAMEL-11473). It logged nothing about it, although after a restart it does not resume from its committed offsets (with the default `autoOffsetReset=latest` the records sent during the restart are not consumed), and each instance of the application receives every record. - CAMEL-27059: `KafkaConsumer` now logs a WARN when such a consumer starts, with the topic, the generated group and the advice to set `groupId`. The generated group stays the default. - CAMEL-27075: a `group.id` set in `additionalProperties` (`additionalProperties.group.id` on the endpoint, or `camel.component.kafka.additional-properties[group.id]`) was replaced by the generated group id, because `KafkaConsumer` put the group into the Kafka properties after the additional properties. The consumer now uses it, and generates a group id (and logs the WARN) only when neither `groupId` nor `additionalProperties` set the group. `groupId` still takes precedence when both are set. The health check reads the group from the same properties, so it shows the group in use. `exactlyOnce` still requires the `groupId` option, as documented. - The `groupId` option description no longer says the option is required for consumers. It says what happens without it, and that it takes precedence over `group.id` in `additionalProperties` (regenerated into `kafka.json`, the catalog and the component/endpoint DSL). - The component page has a new "Consumer groups" section, which also covers `group.id` in `additionalProperties`, and the consumer examples (idempotent consumer, pausable consumer, "Consuming messages from Kafka") set `groupId`. Tests: `KafkaConsumerGroupIdTest` (new, 7 tests). The two tests without `groupId` fail before CAMEL-27059 (no WARN) and pass after. The two tests with `group.id` in the `additionalProperties` of the endpoint and of the component fail before CAMEL-27075 (the consumer used a generated UUID) and pass after. The controls (`groupId` alone, `groupId` with a different `group.id` in `additionalProperties`, a blank `group.id`) pass before and after. The camel-kafka unit tests pass (1358 run, 0 failures, 1 skipped). Upgrade guide: `camel-4x-upgrade-guide-4_24.adoc`, "camel-kafka - a consumer without groupId logs a WARN" and "camel-kafka - a consumer uses the group.id set in additionalProperties". _Claude Code on behalf of Federico Mariani_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
