I am using kafka console tools and trying to set it up that if at least one kafka server instance remains online, it's still possible to send and receive messages, while using replication.
Configuration : Zookeeper (localhost:2181), kafka1 (localhost:9092), kafka2 (localhost:9093), producer1 (localhost:9092), producer2(localhost:9093), consumer1 (localhost:9092), consumer2 (localhost:9093)
Topic : partitions=6, replication=2
If kafka1 server is online, sending and receiving messages always works, no matter state of kafka2. But if kafka1 is offline and kafka2 is online, sent messages are commited - offset increases, but it cannot be read by any of consumer1 and consumer2 till kafka1 comes back online - after that messages are delivered.
Seems to me that messages need to be replicated to kafka1 to be delivered.
So, my questions :
1) Why kafka1 needs to be online for both consumers to be able to receive messages ?
2) Does producer1 configure itself to write to kafka2, when kafka1 is offline ?
3) If 2) is true, why doesn't consumer1 configure itself to read from kafka2 ?
4) While kafka1 is offline, why consumer 2 doesn't receive messages ?
Thanks for any responses :)