Ensure Event processing in order

Bhanu Akaveeti 0 Reputation points
2023-03-16T16:03:45.3833333+00:00

I have a Topic in Azure Service bus which is subscribed by an external process to write (insert or update) data in the message to a database (SQL Server). I noticed that at times, two different messages with the same database key could arrive/publish in the topic at the same time resulting in one of the message being inserted in the DB table and the other being errored with 'duplicate key' on the table.

Is there a way I can add some extra latency in the Topic (Subscription) to ensure messages are processed/consumed in order and with some wait time?

Any alternate services in Azure (like Event Hub or Storage Queue) that could handle this requirement better?

Thanks in advance!

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
572 questions
Azure Event Hubs
Azure Event Hubs
An Azure real-time data ingestion service.
581 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sudipta Chakraborty - MSFT 1,101 Reputation points Microsoft Employee
    2023-03-16T19:12:34.04+00:00
    0 comments No comments