找不到类org.apache.kafka.abstracts.serialization.StringDeserializer

时间:2018-05-15 05:04:40

标签: apache-kafka

我正在和卡夫卡合作。并在描述中获取消息。我在我的消费者类中设置反序列化器的属性。

props.put("key.deserializer",  "org.apache.kafka.abstracts.serialization.StringDeserializer");
props.put("value.deserializer",  "org.apache.kafka.abstracts.serialization.StringDeserializer");

producer = new KafkaProducer<>(props);

仍然在运行时我收到无法找到解串器的错误。我们最近从10.0.1升级到10.1.1是否有我失踪的变化?

1 个答案:

答案 0 :(得分:0)

Kafka的String deserualizer是 &#39; org.apache.kafka.common.serialization.StringDeserializer&#39;

https://github.com/apache/kafka/blob/0.10.0/clients/src/main/java/org/apache/kafka/common/serialization/StringDeserializer.java