Unable to parse multiple json received in kafka Eventhub
Hi All,
I have a Eventhub to receive messages as and when they are published.I may receive multiple json messages.So i parse each of them using the Property-list-data field and try to assert certain fields in
all the received jsons.
But i am getting a error when i try to access a particular field in the received json.
I am trying something like this.
Error :
groovy.lang.MissingPropertyException: No such property: eventID for class: java.lang.String
error at line: 20
Json that is received is as .I receive multiple such json in the same format.
{
"eventID" : "1234546",
"eventTimeStamp" : "2017-07-21T17:32:28Z",
"eventType" : "EVENT_PUB",
"Identifier1" : "",
"Identifier2" : "",
"shipinfo" : {
"InfoNumber" : "123456",
"originLoc" : "IND",
"destLoc" : "IND",
},
}
Please help .What am i missing here.