Package org.apache.kafka.common
Interface MessageFormatter
- All Superinterfaces:
- AutoCloseable,- Closeable,- Configurable
This interface allows to define Formatters that can be used to parse and format records read by a
  Consumer instance for display.
 The kafka-console-consumer has built-in support for MessageFormatter, via the --formatter flag.
 Kafka provides a few implementations to display records of internal topics such as __consumer_offsets,
 __transaction_state and the MirrorMaker2 topics.
- 
Method SummaryModifier and TypeMethodDescriptiondefault voidclose()Closes the formatterdefault voidConfigures the MessageFormattervoidwriteTo(ConsumerRecord<byte[], byte[]> consumerRecord, PrintStream output) Parses and formats a record for display
- 
Method Details- 
configureConfigures the MessageFormatter- Specified by:
- configurein interface- Configurable
- Parameters:
- configs- Map to configure the formatter
 
- 
writeToParses and formats a record for display- Parameters:
- consumerRecord- the record to format
- output- the print stream used to output the record
 
- 
closedefault void close()Closes the formatter- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
 
 
-