This Confluence has been LDAP enabled, if you are an ASF Committer, please use your LDAP Credentials to login. Any problems file an INFRA jira ticket please.

Child pages
  • KIP-431: Support of printing additional ConsumerRecord fields in DefaultMessageFormatter
Skip to end of metadata
Go to start of metadata

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