Failed to parse message from Kafka nifi.serialization.MalformedRecordException
HI All,
Im getting below error after new fileds are being added to the payload from Kafka
OpenTX, datatype: double precision
charges, Datatype: string
note:before these 2 fields added to the payload its working fine with existing json reader and writer
Error:
05:25:40 UTCERRORConsumeKafkaRecord_2_6[id=8f8pq352c-0rcb] Failed to parse message from Kafka using the configured Record Reader. Will route message as its own FlowFile to the 'parse.failure' relationship: org.apache.nifi.serialization.MalformedRecordException: Successfully parsed a JSON object from input but failed to convert into a Record object with the given schema
- Caused by: org.apache.nifi.serialization.record.util.IllegalTypeConversionException: Cannot convert value [[Ljava.lang.Object;@6b9b8a0c] of type class [Ljava.lang.Object; for field invoiceLineList.ecoTaxValues to any of the following available Sub-Types for a Choice: [ARRAY[STRING], ARRAY[DOUBLE]]
input payload:
{
"Identifier":"123456",
"creationDate":"2024-11-22T12:22:01.331894Z",
"docType":"01",
"currency":"INR",
"taxCode": [null,null,null,"04",null,null,null,null,null],
"invoiceLineList": [
{
"line":1,
"charges":["009",null,null],
"OpenTX": [0.3,0.9,null,null]
},
{
"line":2,
"charges":["002",null,null],
"OpenTX": [0.1,1.9,null,null]
}
]
}
below are the json reader and writer configs.
JSONTreeReader:

JSONrecordSETWriter

i've tried changing reader to AVRO reader using "Confluent Content-Encoded Schema Reference" in the Avro Reader "Schema Access Strategy" field and keeping JsonRecordsetwriter same as above but still its not working,
Can anyone help me here?
thanks!!

