davsclaus opened a new pull request, #3352:
URL: https://github.com/apache/camel-kamelets/pull/3352

   Follows [CAMEL-27379](https://issues.apache.org/jira/browse/CAMEL-27379), 
merged on Camel main for 4.24.0. It adds the camel-kafka-share option 
`shareAutoOffsetReset`. When the consumer starts, the option sets the group 
config `share.auto.offset.reset` through the Kafka Admin client.
   
   ## Changes
   
   - kafka-share-source gets a new option, `autoOffsetReset`, mapped to 
`shareAutoOffsetReset`:
     - The values are `earliest`, `latest` or `by_duration:<ISO-8601 
duration>`, checked with a `pattern`.
     - When it is not set, the group config is left as it is, as before.
   - "Good to know" says that a new share group starts at the newest records 
unless `autoOffsetReset` is `earliest`. Before, it pointed to 
`kafka-configs.sh`. It also says:
     - setting the option needs the `ALTER_CONFIGS` permission on the group;
     - the Kamelet does not start when the setting fails;
     - the setting only applies to partitions the group has not read yet, and 
to all the consumers of the group.
   - The two share tests use `autoOffsetReset: earliest`. 
`share-group-earliest.groovy`, which set the group config with the Admin 
client, is removed.
   
   ## Tests
   
   Local `KafkaIT`: **16 tests, 16 passed**, including 
`kafka-share-source-route-test` and `kafka-share-schema-registry-route-test`.
   
   Checked by hand with `camel run` against `apache/kafka:4.4.0`:
   
   | Case | Result |
   |---|---|
   | `autoOffsetReset: latest` | The log says `Setting 
share.auto.offset.reset=latest on share group: g-latest`. `kafka-configs.sh 
--entity-type groups --describe` shows 
`DYNAMIC_GROUP_CONFIG:share.auto.offset.reset=latest`. |
   | `by_duration:PT1H` | The group config is `by_duration:PT1H`. A new group 
with this value read a record sent before it started. |
   | `latest` on a new group | The same earlier record is not read. |
   | An unreachable broker | Start fails with `Cannot set 
share.auto.offset.reset=latest on the share group g-bad (the 
shareAutoOffsetReset option): Timed out waiting for a node assignment...`. |
   
   The `ALTER_CONFIGS` permission was not checked locally. That needs a Kafka 
with ACLs; the text follows the error message of the component ("The principal 
of the consumer needs the ALTER_CONFIGS permission on the group").
   
   ## Upgrade note
   
   ```
   * `kafka-share-source` has a new option `autoOffsetReset` (`earliest`, 
`latest` or `by_duration:<duration>`), which sets the group config 
`share.auto.offset.reset` when the Kamelet starts; it needs the `ALTER_CONFIGS` 
permission on the group, and the Kamelet does not start when it cannot be set.
   ```
   
   _Claude Code on behalf of Claus Ibsen_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_016Y4dDmBDsSWV117kccuNf9
   


-- 
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]

Reply via email to