Hi,

Greetings!

My requirement is as below.

I have Topic named  "sample-topic".  This topic contains the same keys(as
String) with multiple messages and the messages are in JSON format. I would
like to merge the JSON messages and produce a final JSON. In order to
achieve this, how to maintain the state of the previous message?

Below are the input messages in the topic.

Key : 0       Message: {    "attr1" : "value1", "attr2" : "value_01",
"attr3" :"value_3" }

Key : 1       Message: {     "attr1": "value_x", "attr2": "value2" ,
"attr3" : "value_y"}

Key : 2       Message: {     "attr1": "value_m", "attr2": null , "attr3" :
"value_o"}


Now, I need the resultant JSON as below.

{ "attr1": "value_m", "attr2": "value2" , "attr3" : "value_o"}


Could someone help me by letting me know the solution? Thank you.

Thanks

C Suresh

Reply via email to