How to pass multiple bootstrap servers for listener using spring-kafka

Viewed 21610

I have a listener that need to read from multiple kafka servers with the same topic which are all configured under one zookeeper. How do I read from those multiple servers. Can you please help with this.

Instead of Kafka servers, can I point to zookeeper instead?

2 Answers

The map has key: String and Value: Object.

The Object of key:ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG should be series of host-port pair seperated by ',' like: host1:port1,host2:port2,host3:port3 ......

e.g for listening three servers: localhost:9092,192.168.22.12:9088,localhost:7898

Related