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

   Implement [KIP-1232](https://cwiki.apache.org/confluence/x/Hgp3Fw).
   
   - Deprecate the `broker.id` configuration for removal in Kafka 5.0.
   - Log a deprecation warning at broker startup when `broker.id` is explicitly 
set, pointing users to `node.id`.
   - Clean up redundant `broker.id` settings in test files — `node.id` alone is 
enough via the existing synonym mechanism.
   
   The check is done on the raw properties in `KafkaConfig.fromProps` because 
`populateSynonyms` copies `node.id` into `broker.id`, so `originals()` cannot 
tell whether the user actually set it. It is not guarded by `doLog`, since the 
broker startup path calls `fromProps` with `doLog = false`.
   
   Test result:
   
   ```
   # broker.id=1
   ❯ bin/kafka-server-start.sh /tmp/kip1232.properties
   [2026-07-28 23:49:14,050] INFO Registered `kafka:type=kafka.Log4jController` 
MBean (org.apache.kafka.server.logger.Log4jControllerRegistration)
   [2026-07-28 23:49:14,114] WARN The 'broker.id' configuration is deprecated 
and will be removed in Apache Kafka 5.0. Please use 'node.id' instead. 
(kafka.server.KafkaConfig$)
   
   # node.id=1
   ❯ bin/kafka-server-start.sh config/server.properties
   [2026-07-28 23:52:45,352] INFO Registered `kafka:type=kafka.Log4jController` 
MBean (org.apache.kafka.server.logger.Log4jControllerRegistration)
   [2026-07-28 23:52:45,461] INFO Registered signal handlers for TERM, INT, HUP 
(org.apache.kafka.common.utils.internals.LoggingSignalHandler)
   [2026-07-28 23:52:45,462] INFO [ControllerServer id=1] Starting controller 
(kafka.server.ControllerServer)
   ```
   


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