Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I looking for some design help..
So currently I have tKafkaInput --> tExtractJSONFields. Works great. Then a crinkle came in where the kafka topic is now sending different JSON schemas depending on the type of message. So from what I've read/understand, if I have an array within a JSON payload, I have path to that array via the "Loop Jsonpath query" textbox in the component, to parse the array. Well the issue arises when I first mentioned the kafka topic sending totally different schemas (again depending on the message type), so in tExtractJSONFields when I path to the toRecipients array (this message related to emails), I get an error when the message being received is not an email message, because the other message type doesn't have a toRecipients array!
Any suggestions, how I can parse only the email messages from Kafka? Should I send the JSON to SQL Server, filtering only on email types, and parse it from there somehow. Or is there a way to use back to back tExtractJSONFields? I can store the whole JSON payload in a field and then parse the field in another tExtractJSONFields? Or some other way?
Thanks all this has been resolved. I just had to use several tExtractJSON components passing payloads between each, filtering based on certain properties between each.
First of all, what error message do you get while trying to read an none existing attribute.
In general I would try to filter the objets by attributes identifying the type and extract the needed values from the filtered objects.
Could you please post an example of such an JSON response and do not forget posting here the error you get (my first question).
Thanks all this has been resolved. I just had to use several tExtractJSON components passing payloads between each, filtering based on certain properties between each.