0
votes

I am new to Kafka with Spring Boot.

We can able to send kafka message in Json / String / Streams / JsonNode / Map. So right now in my project I want to send Map to one of my consumers.

So as a steps first we will convert map to JsonNode and then will send JsonNode. At consumer, we will deserilise this JsonNode into map and then will use.

I tried to send Map and I can able to send via kafka. When at consumer i am getting Json String.

So my question is which is the best way to implement in my requirement ?

1

1 Answers

1
votes

My opinion - neither.

Use Avro (or Protobuf) model classes that clearly define your types and the Schema Registry


In other words, Kafka stores bytes. You can pick any serialization format, and you better compress it as well