How should I design MessageId and PartitionKey for Azure Service Bus duplicate detection to safely retry sends without creating duplicate messages in a partitioned queue?
0 reputation · 24 Apr 2025, 23:54 UTC
An application sends a message to an Azure Service Bus queue and may experience a transient failure after the send operation, leaving it uncertain whether the message was stored. To recover, the application may resend the same message with a previously used MessageId. How can duplicate detection be configured together with partitioning to guarantee that a resent message is recognized as a duplicate and not stored a second time, while still allowing distinct messages for different business contexts?