There is a nodejs Kafka producer which send the file content to Kafka. When Kafka consumer consumed the messages from Kafka it looks like -
{"type":"Buffer","data":[91,13 .....]
When I used m.message.value.toString('utf8')
in nodejs Kafka consumer, it print the actual message. But I need to consume in java Kafka consumer. I tried with property.put("value.serializer.encoding", "utf8")
and new String(consumerRecord.value())
but still print {"type":"Buffer","data":[91,13 .....]
. My question is how to consume message in string format in java which is produced by nodejs Kafka producer.