Issue with ArrayList Serde in Kafka Streams API

前端 未结 1 786
迷失自我
迷失自我 2020-12-19 14:59

Based on my previous question, I am still trying to figure out what\'s the issue with my code.

I\'ve got a most basic topic possible: keys and values are a type of <

相关标签:
1条回答
  • 2020-12-19 15:18

    As the error indicates, all Serdes need to have a non-argument constructor:

    Caused by: org.apache.kafka.common.KafkaException: Could not instantiate class utils.ArrayListSerde Does it have a public no-argument constructor?

    You class ArrayListSerde does only have constructor:

    public ArrayListSerde(Serde<T> serde) { ... }
    

    Thus, we get this error.

    Compare ArrayListSerializer:

    // Default constructor needed by Kafka
    public ArrayListSerializer() {}
    

    Update:

    A standard implementation for ListSerde is WIP and should be included in 2.7 release making custom List Serde obsolete: https://issues.apache.org/jira/browse/KAFKA-8326

    0 讨论(0)
提交回复
热议问题