title: How can i handle duplicate records in MySQL database in microservice architecture?
body: <p>Due to an duplicate events coming from an event-driven architecture, there are duplicate records being saved to the database.</p>
  <p>This is causing an issue. I did add duplicate constraint to the table, but now I don't know how to handle the exception in case of saveAll.</p>
  <p>One thought that comes to my mind is a recursive approach.. but since it is unpredictable as to how many duplicate events may occur, the no. of retries cannot be determined and obviously, I cannot use an infinite recursive loop.</p>