TracingKafkaClientSupplier 错误 "Implementations of KafkaClientSupplier should implement the getAdmin() method"
TracingKafkaClientSupplier error "Implementations of KafkaClientSupplier should implement the getAdmin() method"
我正在将 Spring Boot 应用程序升级到 Boot 2.6.1、Cloud 2021.0.0 和 Cloud Stream 3.2.1。
此应用程序有一堆 KStreams,例如:
@Bean
fun processEvent() =
Function<KStream<ID, EventReceived>, KStream<Id, UpdatedInfo?>> { events ->
...
}
现在应用程序在启动时崩溃:
Caused by: org.springframework.kafka.KafkaException: Could not start stream: ; nested exception is java.lang.UnsupportedOperationException: Implementations of KafkaClientSupplier should implement the getAdmin() method.
at org.springframework.kafka.config.StreamsBuilderFactoryBean.start(StreamsBuilderFactoryBean.java:359)
at org.springframework.cloud.stream.binder.kafka.streams.StreamsBuilderFactoryManager.start(StreamsBuilderFactoryManager.java:107)
... 15 common frames omitted
Caused by: java.lang.UnsupportedOperationException: Implementations of KafkaClientSupplier should implement the getAdmin() method.
at org.apache.kafka.streams.KafkaClientSupplier.getAdmin(KafkaClientSupplier.java:40)
at org.apache.kafka.streams.KafkaStreams.<init>(KafkaStreams.java:846)
at org.apache.kafka.streams.KafkaStreams.<init>(KafkaStreams.java:711)
at org.springframework.kafka.config.StreamsBuilderFactoryBean.start(StreamsBuilderFactoryBean.java:337)
... 16 common frames omitted
这可能是什么问题?
更新
我发现有问题的 clientSupplier 是 brave.kafka.streams.TracingKafkaClientSupplier
:
这个class没有实现KafkaClientSupplier
(kafka-streams 3.0.0)的预期方法:
您应该针对 Brave 打开一个问题 - 或者可能有一个与 3.0.0 Kafka jar 兼容的更新版本。
同时,您应该可以将 kafka-clients 和 kafka-streams 降级到 2.8.1。
如果您使用嵌入式kafka broker 进行测试,您还需要降级一些其他的jar。参见 https://docs.spring.io/spring-kafka/docs/2.8.1-SNAPSHOT/reference/html/#update-deps
我正在将 Spring Boot 应用程序升级到 Boot 2.6.1、Cloud 2021.0.0 和 Cloud Stream 3.2.1。
此应用程序有一堆 KStreams,例如:
@Bean
fun processEvent() =
Function<KStream<ID, EventReceived>, KStream<Id, UpdatedInfo?>> { events ->
...
}
现在应用程序在启动时崩溃:
Caused by: org.springframework.kafka.KafkaException: Could not start stream: ; nested exception is java.lang.UnsupportedOperationException: Implementations of KafkaClientSupplier should implement the getAdmin() method.
at org.springframework.kafka.config.StreamsBuilderFactoryBean.start(StreamsBuilderFactoryBean.java:359)
at org.springframework.cloud.stream.binder.kafka.streams.StreamsBuilderFactoryManager.start(StreamsBuilderFactoryManager.java:107)
... 15 common frames omitted
Caused by: java.lang.UnsupportedOperationException: Implementations of KafkaClientSupplier should implement the getAdmin() method.
at org.apache.kafka.streams.KafkaClientSupplier.getAdmin(KafkaClientSupplier.java:40)
at org.apache.kafka.streams.KafkaStreams.<init>(KafkaStreams.java:846)
at org.apache.kafka.streams.KafkaStreams.<init>(KafkaStreams.java:711)
at org.springframework.kafka.config.StreamsBuilderFactoryBean.start(StreamsBuilderFactoryBean.java:337)
... 16 common frames omitted
这可能是什么问题?
更新
我发现有问题的 clientSupplier 是 brave.kafka.streams.TracingKafkaClientSupplier
:
这个class没有实现KafkaClientSupplier
(kafka-streams 3.0.0)的预期方法:
您应该针对 Brave 打开一个问题 - 或者可能有一个与 3.0.0 Kafka jar 兼容的更新版本。
同时,您应该可以将 kafka-clients 和 kafka-streams 降级到 2.8.1。
如果您使用嵌入式kafka broker 进行测试,您还需要降级一些其他的jar。参见 https://docs.spring.io/spring-kafka/docs/2.8.1-SNAPSHOT/reference/html/#update-deps