You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Status

Current stateVoting in progress

Discussion thread: here

JIRA: KAFKA-6733

PR: #4807

Motivation

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:

  • print.timestamp
  • print.key
  • print.value
  • key.separator
  • line.separator
  • key.deserializer
  • value.deserializer

So there is no way to print message offset, partition and headers.

Public Interfaces

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

Proposed Changes

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.

Rejected Alternatives

None

  • No labels