webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only

Kafka Adapter is unable to serialize a record when it contains both another record and an array of records

  • 1.  Kafka Adapter is unable to serialize a record when it contains both another record and an array of records

    Posted Wed October 19, 2022 06:01 AM

    This is actually a reply to this other message Getting error in Kafka Adapter , to which I can’t reply because it is closed.

    The same Exception reported there (ClassCastException: java.util.ArrayList cannot be cast to org.apache.avro.generic.IndexedRecord) happened to me, and at least in my case it happened when publishing to Confluent Kafka a message using an Avro schema that defined a record (structure) that in turn contained, as direct children, both another record and an array of records. I.e. an schema such as:

    • record1
      • array of record2
      • record3

    This can be worked around if you change the Avro schema so that the array of record2 is not a direct child of record1, but it is wrapped inside another record; i.e.:

    • record1
      • record4
        • array of record2
      • record3

    This must be a bug in Kafka Adapter. If I have time, I will file an SI in Empower.


    #webMethods
    #Adapters-and-E-Standards
    #Integration-Server-and-ESB