justinrlee opened a new pull request, #12797:
URL: https://github.com/apache/kafka/pull/12797
This is a relatively minor quality of life change.
Currently, some of the various `kafka-X` commands (which wrap various Kafka
admin calls) require that `--bootstrap-server` (or, occasionally
`--bootstrap-servers`) be specified in the CLI, regardless of whether that
property is specified in a specified property file.
The purpose of this PR is to remove that requirement. This PR may not cover
all commands, but will hopefully address the most common ones. I will remove
`WIP` when I've completed made these changes to several scripts (likely,
kafka-broker-api-versions, kafka-topics, kafka-configs, kafka-console-producer,
and kafka-console-consumer)
Scripts updated so far:
* kafka-broker-api-versions
Not yet updated:
* kafka-topics
* kafka-configs
* kafka-console-producer
* kafka-console-consumer
Notes:
* Many of these scripts aren't separately documented (aside from
changelogs), so I'm not currently changing any documentation for these
* There is currently minimal test coverage, so at this point I'm not adding
any additional tests (but will adjust tests as applicable)
* These changes should be non-breaking. Specifically:
* For situations where the flag was previously specified, it will
continue to be used (and take precedence over the property file), and the
command will continue to work (or not work) as it previously would
* For situations where the flag was not previously specified AND
`bootstrap.servers` was _not_ configured in the property file, the command
would previously fail and will continue to fail
* For situations where the flag was not previously specified AND
`bootstrap.servers` was configured in the property file, the command would
previously fail; now it will work
For example, specifying ONLY the property file without `bootstrap.servers`
specified will result in output that looks like this, which is fairly intuitive
to address:
```shell
./kafka_2.13-3.4.0-SNAPSHOT/bin/kafka-broker-api-versions.sh
--command-config client-no-bootstrap.properties
Exception in thread "main" org.apache.kafka.common.config.ConfigException:
Missing required configuration "bootstrap.servers" which has no default value.
at
org.apache.kafka.common.config.ConfigDef.parseValue(ConfigDef.java:493)
at org.apache.kafka.common.config.ConfigDef.parse(ConfigDef.java:483)
at
org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:113)
at
org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:146)
at
kafka.admin.BrokerApiVersionsCommand$AdminClient$AdminConfig.<init>(BrokerApiVersionsCommand.scala:265)
at
kafka.admin.BrokerApiVersionsCommand$AdminClient$.create(BrokerApiVersionsCommand.scala:269)
at
kafka.admin.BrokerApiVersionsCommand$AdminClient$.create(BrokerApiVersionsCommand.scala:267)
at
kafka.admin.BrokerApiVersionsCommand$.createAdminClient(BrokerApiVersionsCommand.scala:79)
at
kafka.admin.BrokerApiVersionsCommand$.execute(BrokerApiVersionsCommand.scala:60)
at
kafka.admin.BrokerApiVersionsCommand$.main(BrokerApiVersionsCommand.scala:55)
at
kafka.admin.BrokerApiVersionsCommand.main(BrokerApiVersionsCommand.scala)
```
*Summary of testing strategy (including rationale)
for the feature or bug fix. Unit and/or integration
tests are expected for any behaviour change and
system tests should be considered for larger changes.*
### Committer Checklist (excluded from commit message)
- [x] Verify design and implementation
- [ ] Verify test coverage and CI build status
- [ ] Verify documentation (including upgrade notes)
--
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]