Status

Current state: (4x+1 binding, 1x+1 non-binding)

Discussion thread: here

Vote thread: here

JIRA

Pull Request: here

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 in addition to the existing option --property.

It will be useful in different use cases:

Public Interfaces

Add an option:

As for --producer-property/--consumer-property with --consumer.config/--producer.config, any value from option --property would override value from config file.

Simple example

Mixed example

When a property is in the config file and as option, option wins.

print.timestamp=true
print.key=true
print.offset=true
print.partition=true
print.headers=true
print.value=true
key.separator=:
line.separator=;
headers.separator=|


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.

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