xxxxxxxxxx
Kafka can now be used without ZooKeeper as of version 2.8.
The release of Kafka 2.8.0 in April 2021 gave us all the opportunity to try it out without ZooKeeper.
However, this version is not yet ready for production and lacks some key features.
In the previous versions, bypassing Zookeeper and connecting directly to the Kafka broker was not possible.
This is because when the Zookeeper is down, it is unable to fulfill client requests.
Post Version 2.8 we Can use Kafka without Zookeeper
xxxxxxxxxx
@Component
@KafkaListener(id = "multiGroup", topics = "multitype")
public class MultiTypeKafkaListener {
@KafkaHandler
public void handleGreeting(Greeting greeting) {
System.out.println("Greeting received: " + greeting);
}
@KafkaHandler
public void handleF(Farewell farewell) {
System.out.println("Farewell received: " + farewell);
}
@KafkaHandler(isDefault = true)
public void unknown(Object object) {
System.out.println("Unkown type received: " + object);
}
}
https://www.confluent.io/blog/kafka-without-zookeeper-a-sneak-peek/