Avoid duplicate message processing

I have a process that is picking messages from a queue and processing them. If for some reason, I get duplicate messages on the queue, I need to process the first message only and reject the duplicate requests. I have a microservices architecture so there can be multiple instances of my microservice. How do I find out duplicate requests and reject them?

You could use a business key for each instance and use that to ensure that correlation to a single instance is enforced.

Thanks Niall. I have gone through some of the documentation on using business keys and the below link details what I am looking for - How to Start ProcessInstance idempotently?

1 Like