I am doing poc of confluent kafka connect version 5.2.3. We are trying to copy message of topic a file as backup and from this file back to topic when we need it.
Topic has Key =string Value=protbuf
I am using
key.convertor=org.apache.kafka.connect.storgare.StringConvertor
value.convertor=com.blueapron.connect.protobuf.ProtobufConvertor
value.convertor.protoClassName=<proto class name>
Sink config
name=test
connector.class=FileStreamSink
tasks.max=1
file=test.txt
topics=testtopic
Source config
name=test
connector.class=FileStreamSource
tasks.max=1
file=test.txt
topics=testtopic_connect
I am able successfully sink it to a file with file content as below
Struct{<message in name value pair>}
Struct{<message in name value pair>}
....
The same file i use to source it back to a different topic. When i run the source it throw error
String cannot be casted to org.apache.kafka.connect.data.Struct.
Questions are
- Why i do not see any key in the file when my kafka topic has key value pair.
- Why source is not able to copy the content from file to topic and throwing casting related error.
- I get the similar error when i use ByteArrayConvertor provided by kafka. String cannot be casted to bytes. Ideally ByteArrayConvertor should work for any kind of data.
- Does blueapron only works with protobuf3 version?