...
As for --producer-property
/--consumer-property
with --consumer.config
/--producer.config
, any value from option --property
would override value from config file.
Simple example
Before (multiple
--property
options):Code Block language bash kafka-console-producer.sh [...] --property print.timestamp=true \ --property print.key=true \ --property print.offset=true \ --property print.partition=true \ --property print.headers=true \ --property print.value=true \ --property key.separator=':' \ --property line.separator=';' \ --property headers.separator='|'
After (all properties in one file):
Code Block language applescript title reader-config.properties print.timestamp=true print.key=true print.offset=true print.partition=true print.headers=true print.value=true key.separator=: line.separator=; headers.separator=|
Code Block language bash kafka-console-producer.sh [...] --reader-config reader-config.properties
Mixed example
When a property is in the config file and as option, option wins.
Code Block | ||||
---|---|---|---|---|
| ||||
print.timestamp=true
print.key=true
print.offset=true
print.partition=true
print.headers=true
print.value=true
key.separator=:
line.separator=;
headers.separator=| |
Code Block | ||
---|---|---|
| ||
kafka-console-producer.sh [...] --reader-config reader-config.properties --property key.separator='/' |
Then, the MessageReader
will get key.separator=/
, not key.separator=:
Proposed Changes
Implement the new options as described in Public Interfaces section.
Already implemented in pull request #12175.
...