Status
Current state: Under Discussion
Discussion thread: here
JIRA:
Motivation
Tools kafka-console-producer.sh
and kafka-console-consumer.sh
have the multiple option --property
to setup the MessageReader
for Producer (defined by --line-reader
) or the MessageFormatter
for Consumer (defined by --formatter
).
To setup the KafkaProducer
/KafkaConsumer
they have the multiple option --producer-property
/--consumer-property
and the config file option --consumer.config
/--producer.config
.
The idea is to offer the same possibility to use a config file option to setup the MessageReader
/MessageFormatter
.
It will be useful in different use cases:
- when having multiple
--property
(the default reader can have up to 11 properties) - when passing properties with sensitive data (like
schema.registry.ssl.truststrore.password
forkafka-avro-console-producer
) (could also be mitigated by using env vars)
Public Interfaces
Add an option --config
to tools kafka-console-producer.sh
and kafka-console-consumer.sh
Alternative: --reader.config
for Producer and --formatter.config
for Consumer, so it is less generic (but on the other hand, the current --property
is quite generic already) and cannot be confused with other config --consumer.config
/--producer.config
.
As for --producer-property
/--consumer-property
with --consumer.config
/--producer.config
, any value from option --property
would override value from config file.
Proposed Changes
Already implemented in pull request #12175.
Compatibility, Deprecation, and Migration Plan
No impact on existing users, just a new possibility available.
Test Plan
Launch the tools with the new config file option and check that properties from config file are applied to the reader/formatter.
Define a property in config file and in options and check that option override config file.
Rejected Alternatives
None.