Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

TracingKafkaClientSupplier error "Implementations of KafkaClientSupplier should implement the getAdmin() method"

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:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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:

enter image description here

This class doesn’t implement the expected method from KafkaClientSupplier (kafka-streams 3.0.0):

enter image description here

enter image description here

>Solution :

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

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading