...
e.g kafka-console-producer.sh --brokerbootstrap-list localhostserver `hostname`:9092 --topic my_topic < my_filetest-01 < 1.txt (Only supports reading a single file)
...
The current implementation scheme is not complicated, it does not have much difference with Line MessageReader, but in order to distinguish it from Line, I extracted FileMessageReader.
MessageReader
...
.
...
...
language | scala |
---|---|
title | MessageReader |
...
trait MessageReader {
def init(inputStream: InputStream, props: Properties): Unit = {}
def readMessage(): ProducerRecord[Array[Byte], Array[Byte]]
def close(): Unit = {}
}
FileMessageReader
...
FileMessageReader
...
FileMessageReader will be used to detect the availability of the input file list and read multiple files.
Compatibility, Deprecation, and Migration Plan
...