Hi, I am using Kafka connect to feed data into kafka, please find sample code snippet from Source Task. My question is , why kafka connect dematerialize JSON message by escaping double quotes? Is there way to get the same without escaping?
byte[] message = null; Charset charset = Charset.forName("UTF-8"); String strMsg = new String(message, charset); log.info(strMsg); SourceRecord record = new SourceRecord(partition, null, topic, ConnectSchema.STRING_SCHEMA,strMsg); >From kafka console consumer : {"schema":{"type":"string","optional":false},"payload":" { \"index\" : { \"_index\" : \"test\", \"_type\" : \"rex\", \"_id\" : \"1\" } }\n"} >From log.info() : What I really expect INFO { "index" : { "_index" : "test", "_type" : "rex", "_id" : "1" } } Cheers, Dhanuka -- Nothing Impossible,Creativity is more important than knowledge.