From the official documentation in Kafka as a Storage System:
Data written to Kafka is written to disk and replicated for fault-tolerance. Kafka allows producers to wait on acknowledgement so that a write isn't considered complete until it is fully replicated and guaranteed to persist even if the server written to fails.
Write a new Kafka producer ProducerAcksDemo
that uses ProducerConfig.ACKS_CONFIG:
The number of acknowledgments the producer requires the leader to have received before considering a request complete.
- Read the official documentation about the acks configuration property.
- Configure a 3-broker Kafka cluster
- Create a topic with one partition and the replication factor of 3
- Write a Kafka producer
ProducerAcksDemo
that uses the different levels ofacks
:acks=0
acks=1
acks=all
- Observe their behaviour
- How does
acks
relate tomin.insync.replicas
configuration property?- "A typical scenario would be to create a topic with a replication factor of 3, set min.insync.replicas to 2, and produce with acks of "all". This will ensure that the producer raises an exception if a majority of replicas do not receive a write."
Duration: 30 mins