KafkaException: class is not an instance of org.apache.kafka.common.serialization.Deserializer

后端 未结 2 869
情书的邮戳
情书的邮戳 2021-01-27 12:26

I want to implement Kafka producer which sends and receives Java Serialized Objects. I tried this:

Producer:

@Configuration
publi         


        
2条回答
  •  长情又很酷
    2021-01-27 12:59

    KEY_DESERIALIZER_CLASS_CONFIG is a class which deserializes the network value into proper Java classes. The class you provided doesn't do that.

    In most cases, StringDeserializer is used. Specify a proper deserializer to the factory properties.

提交回复
热议问题