THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
- backward compatibility
kafka.common.MessageReader implementations can keep working without recompilation. - deprecation
- kafka.common.MessageReader is deprecated
- the method init(InputStream inputStream, Properties props) is deprecated and replacement is configure(InputStream inputStream, Map<String, ?> configs)
- migration plan: users have address following changes to complete code migration
- change inheritance from kafka.common.MessageReader to org.apache.kafka.client.tools.RecordReader
- change method signature from init(InputStream inputStream, Properties props) to configure(InputStream inputStream, Map<String, ?> configs)change method signature from readMessage to readRecord
- remove the implementation of readMessage()
- implements the readRecords(InputStream) to return Iterator of records
Rejected Alternatives
- support the usage of Serializers (from Juma): this support could complicate the configs, since users have to define both MessageReader and serializer. It seems to me the mechanism of MessageReader should include serialization.
- move RecordReader to "org.apache.kafka.common": "org.apache.kafka.common" does not allow to import code from "org.apache.kafka.clients.producer". However, the tool-related interface should be able to access producer, consumer and admin code.
new RecordReader implements Configurable: Implementing Configurable will change the arguments of configure method from (InputStream, configs) to (configs). That obstructs RecordReader from keeping input stream itself as some of that state.- configurable(InputStream, configs) - diverges from the Configurable interface and it is strange to pass an InputStream to a configure method.