THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||
---|---|---|
| ||
package org.apache.kafka.common;
import java.io.PrintStream;
import java.util.Properties;
import org.apache.kafka.clients.consumer.ConsumerRecord;
/**
* 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.
* @author mickael
*
*/
public interface MessageFormatter {
/**
* Initializes the MessageFormatter
* @param props Properties to configure the formatter
*/
default public void init(Properties props) {}
/**
* Parses and formats a record for display
* @param consumerRecord the record to format
* @param output the print stream used to display the record
*/
public void writeTo(ConsumerRecord<byte[], byte[]> consumerRecord, PrintStream output);
/**
* Closes the formatter
*/
default public void close() {}
} |
...