Apache Kafka: …StringDeserializer is not an instance of …Deserializer

前端 未结 3 1304

In my simple application i am trying to instantiate a KafkaConsumer my code is nearly a copy of the code from javadoc (\"Automatic Offset Committing\"):

@Slf4j
p         


        
3条回答
  •  天涯浪人
    2021-01-23 06:05

    Not sure if this is what finally fixed your error, but note that when using spring-kafka-test (version 2.1.x, starting with version 2.1.5) with the 1.1.x kafka-clients jar, you will need to override certain transitive dependencies as follows:

    
        org.springframework.kafka
        spring-kafka
        ${spring.kafka.version}
    
    
    
        org.springframework.kafka
        spring-kafka-test
        ${spring.kafka.version}
        test
    
    
    
        org.apache.kafka
        kafka-clients
        1.1.1
    
    
    
        org.apache.kafka
        kafka-clients
        1.1.1
        test
    
    
    
        org.apache.kafka
        kafka_2.11
        1.1.1
        test
    
    
    
        org.apache.kafka
        kafka_2.11
        1.1.1
        test
        test
    
    

    so it could've been a problem with your transitive dependency for sure

提交回复
热议问题