问题如图
Kafka版本为kafka_2.11-2.1.1,springboot版本为2.3.4.RELEASE
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.3.4.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent>
spring-kafka版本为2.2.2.RELEASE
<dependency> <groupId>org.springframework.kafka</groupId> <artifactId>spring-kafka</artifactId> <version>2.2.2.RELEASE</version> </dependency>
把spring-kafka版本修改为2.3.4.RELEASE就可以了