Current state: Voting in progress
Discussion thread: here
ConsoleConsumer is one of the main debugging tools used by Kafka users. Especially for new users and new setups. However, not all possible message (ConsumerRecord) attributes are accessible using it.
Currently we have following parameters which control the ConsoleConsumer output format:
So there is no way to print message offset, partition and headers.
Add extra parameters to DefaultMessageFormatter which will enrich current functionality:
- print.offset – print message offset
- print.partition – print message partition
- print.headers – print headers associated with the message
- header.separator – separator printed after each key:value pair
- headers.deserializer - header value deserializer
New perimeters were described in Public Interfaces section.
Compatibility, Deprecation, and Migration Plan
The changes are backward compatible. If a user won’t use any new parameters, then the output of console consumer will look the same as before.