Spring for Apache Kafka 2.0.x is not compatible with Spring Boot 2.1.x. You have to use Spring-Kafka 2.2.x. More over would be better to just rely on the dependency from Spring Boot per se. please, see https://start.spring.io/ for more info how properly start the project for Spring Boot.


And please, don’t duplicate your question in different places if that was not asked.

在org.springframework.kafka,因为我们使用的springboot 版本是2.1.5.RELEASE,所以版本存在差异化,因此我们修改版本为:

<!-- kafka 依赖 -->
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
<version>2.2.8.RELEASE</version>
</dependency>