org.apache.kafka.common.KafkaException: Failed to construct kafka consumer

Caused by: java.lang.ClassNotFoundException: org.apache.kafka.common.ClusterResourceListener

You are missing the kafka-clients jar from your class path. What are you using for dependency management? Maven and gradle should put this jar on the class path for you automatically.

Your kafka version is older than it should, your problematic class ClusterResourceListener expect version to be higher than, and your version is lower

Just upgrade your kafka jars and it'll fix this issue.

There will be one invocation of onUpdate(ClusterResource) after each metadata response. Note that the cluster id may be null when the Kafka broker version is below