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!