Spring-kafka-test-意外依赖性版本

问题描述 投票:0回答:1
使用弹簧靴3.1.11

Spring -kafka -3.0.16

试图将KAFKA-CLIATERS从3.4.1更新为3.5.1

根据

docs,这三个应该一起工作。 我注意到,春季 - 卡夫卡测试仍然带来了旧客户(3.4.1),这会引起问题。

试图在Spring-Kafka检验中排除或强制以后版本,但具有副作用,并且实际上行不通。

应该根据文档兼容性矩阵工作,那么为什么要较旧的版本?

[btws:

我不想将Spring-Kafka更新为3.1.x,因为它也需要更新Spring-boot]

  1. 手动添加tistimplation'org.apache.kafka:kafka_2.13:3.5.1'在获得运行时异常时无法正常工作(例如Java.lang.lang.noclassdeffounderror:org/apache/apache/kafka/kafka/kafka/kafkametricsgroup)/kafkametricsgroup)

enter image description here如果您在依赖版本中遇到跨性别的问题,则可以使用依赖项管理如下:

<dependencyManagement> <dependencies> <dependency> <groupId>org.apache.kafka</groupId> <artifactId>kafka-clients</artifactId> <version>3.5.1</version> <scope>import</scope> </dependency> </dependencies> </dependencyManagement>
spring-boot apache-kafka spring-kafka
1个回答
0
投票
排除Kafka-clients依赖性

<dependency> <groupId>org.springframework.kafka</groupId> <artifactId>spring-kafka-test</artifactId> <scope>test</scope> <exclusions> <exclusion> <groupId>org.apache.kafka</groupId> <artifactId>kafka-clients</artifactId> </exclusion> </exclusions> </dependency>

	

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.