I'm upgrading a Spring Boot application to Boot 2.6.1, Cloud 2021.0.0 and Cloud Stream 3.2.1.
This application has a bunch of KStreams such as:
@Bean
fun processEvent() =
Function<KStream<ID, EventReceived>, KStream<Id, UpdatedInfo?>> { events ->
...
}
Now the application crashes on startup:
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
What could be the problem here?
UPDATE
I found that the problematic clientSupplier is brave.kafka.streams.TracingKafkaClientSupplier
:
This class doesn't implement the expected method from KafkaClientSupplier
(kafka-streams 3.0.0):
CodePudding user response:
You should open an issue against Brave - or perhaps there's a newer version that's compatible with the 3.0.0 Kafka jars.
In the meantime, you should be able to downgrade the kafka-clients and kafka-streams to 2.8.1.
If you are using the embedded kafka broker for testing, you will need to downgrade some other jars too. See https://docs.spring.io/spring-kafka/docs/2.8.1-SNAPSHOT/reference/html/#update-deps