With acks=all and min.insync.replicas=2, Kafka requires at least two in-sync replicas to acknowledge a write. If only one broker is alive, the condition fails, and NotEnoughReplicasException is thrown by the producer.
From Kafka Producer Exception Docs:
“NotEnoughReplicasException is thrown when the number of in-sync replicas is insufficient to satisfy acks=all with min.insync.replicas.”
NetworkException is generic and not raised here.
NotCoordinatorException is related to consumer group coordination.
NotLeaderForPartitionException is unrelated unless accessing an unassigned leader.
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit