suzhiking opened a new pull request, #22586:
URL: https://github.com/apache/kafka/pull/22586

   ## Summary
   
   It's too easy for users to override a client config that Kafka Streams 
hardcodes and have it silently ignored. KAFKA-14405 asks Streams to log a 
warning in those cases.
   
   Much of this is already handled: 
`checkIfUnexpectedUserSpecifiedClientConfig` warns for configs Streams forces 
via its default-override maps (`enable.auto.commit`, `group.protocol`, 
`allow.auto.create.topics`, and under EOS `isolation.level` / 
`enable.idempotence` / `transactional.id`), and KAFKA-19793 closed the 
consumer-prefix bypass.
   
   The remaining gap is the configs Streams forces with a direct `put()` 
*after* the user props are merged, which bypass that machinery. Two are 
documented as controlled but were silently ignored:
   - `group.id` (forced to `application.id`)
   - `partition.assignment.strategy` (forced to `StreamsPartitionAssignor`)
   
   This adds an `enforceConfig()` helper that logs an error when the user set a 
different value, then applies the Streams value, and wires it up for those two 
on the main consumer.
   
   ### Intentionally not covered
   - `client.id` — Streams *derives* each client id from the user's `client.id` 
(uses it as a base), so it isn't ignored; a warning would be a false positive.
   - restore/global `auto.offset.reset` — carries a Streams-seeded default 
(`earliest`), so comparing it against the forced `none` would warn on every app.
   - `partitioner.class` — changing its handling requires a KIP (per the 
discussion on #12988).
   
   ## Testing
   Added `StreamsConfigTest` cases:
   - `shouldLogErrorAndIgnoreUserOverrideOfGroupId`
   - `shouldLogErrorAndIgnoreUserOverrideOfPartitionAssignmentStrategy`
   - `shouldNotLogErrorWhenUserDoesNotOverrideControlledConfigs` (guards 
against false positives on default-seeded configs)
   
   The full `StreamsConfigTest` suite passes.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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