NotLeaderForPartitionException issue

Hi All, has someone faced NotLeaderForPartitionException. I am using apache camel and i got this exception in between which caused loss of messages so, please let me know if someone faced the same issue and how we can stop losing messages.

Likely with producing, when the leader broker was restarted or unreachable. You might be able to configure retries, by default it’s 0, to make it less likely to lose messages.