Kafka Producer should retry three times in case fail

Viewed 831

I want to implement Kafka producer retry logic three times in case of any failure and also i want to test manually whether producer is retrying or not. Can you suggest me, how to manually test this functionality. In below configuration is added to producer configuration to retry in case of any failure. Thank you.

props.put("retries", 3);
1 Answers

You should trust this core functionality of Kafka, but you can track it with capturing the packets of the Producer.

you can use tcpdump in order sniff packets on the producer server and check how many time they sent:
tcpdump -i any port 9092
I also recommend you to view this answer about using tshark for capturing Kafka.

If you want to investigate the protocol even deeper you can use WireShark.
Check out this guide about how to install WireShark on Linux.

Related