Question
Sun Life Financial Inc
CA
Last activity: 29 Mar 2023 12:47 EDT
Error deserializing stream while reading from Kafka topic
Hello,
We are trying to read from External Kafka Topic. We performed the below steps -
- Created Kafka instance and connection is established successfully.
- Created DataSet and referred the Kafka instance in it and selected the Topic from where we are to read. Data Format is Selected as JSON and Field Mapping is selected as Automatically map fields.
- We are supposed to receive the following JSON - {"first_name":"TestFName","last_name":"TestLName"}
- first_name and last_name properties are created under correct class n ruleset.
- Tried to run the Data Set stand alone in Browse mode.
It is throwing the following error in the Log - " Error deserializing stream while reading from Kafka topic " where the pyFaultReason is showing as :
<pyFaultReason> p{"first_name":"TestFName","last_name":"TestLName"} </pyFaultReason>
It is found that the JSON read from Kafka topic has a leading character 'p' in the beginning which is causing the problem. It is confirmed by the Kafka team that this character is called Magic Byte and it is supposed to be present in the stream as it came as a result of Serialization performed at their end using a schema.
They are suggesting as to use "jsonschema as valueType in our consumer values.yaml, for us not to receive this character.
Hello,
We are trying to read from External Kafka Topic. We performed the below steps -
- Created Kafka instance and connection is established successfully.
- Created DataSet and referred the Kafka instance in it and selected the Topic from where we are to read. Data Format is Selected as JSON and Field Mapping is selected as Automatically map fields.
- We are supposed to receive the following JSON - {"first_name":"TestFName","last_name":"TestLName"}
- first_name and last_name properties are created under correct class n ruleset.
- Tried to run the Data Set stand alone in Browse mode.
It is throwing the following error in the Log - " Error deserializing stream while reading from Kafka topic " where the pyFaultReason is showing as :
<pyFaultReason> p{"first_name":"TestFName","last_name":"TestLName"} </pyFaultReason>
It is found that the JSON read from Kafka topic has a leading character 'p' in the beginning which is causing the problem. It is confirmed by the Kafka team that this character is called Magic Byte and it is supposed to be present in the stream as it came as a result of Serialization performed at their end using a schema.
They are suggesting as to use "jsonschema as valueType in our consumer values.yaml, for us not to receive this character.
I dont think anywhere in the configuration we have option to change / modify yaml for Kafka interchange.
has anyone faced this issue before? any idea how to resolve it.