Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
/**
 * Typical implementations of this interface convert data from an `InputStream` received via `configure` into a
 * `ProducerRecord` instance on each invocation of `readRecord`. Noted that the implementations to have a public
 * nullary constructor.
 *
 * This is used by the `kafka.tools.ConsoleProducer`.
 */
public interface RecordReader extends Closeable, Configurable {
    /**
     * read byte array from input stream and then generate a producer record
     * @param inputStream of message 
     * @return a producer record
     */
    ProducerRecord<byte[], byte[]> readRecord(InputStream inputStream);


    /**
     * Closes this reader
     */
    default void close() {}
}


Proposed Changes

  1. Deprecate kafka.common.MessageReader


Code Block
languagescala
@deprecated("This class has been deprecated and will be removed in 4.0. Please use org.apache.kafka.common.RecordReader instead", "3.5.0")
trait MessageReader


2.  log warning messages to users when using deprecated MessageReader

Compatibility, Deprecation, and Migration Plan

...