Duplicate Detection on Scheduled message in Azure Service Bus

Catherine Du 25 Reputation points Microsoft Employee
2024-11-14T04:07:12.76+00:00

Hello,

The official ASB documentation says "Scheduled messages are included in duplicate detection. Therefore, if you send a scheduled message and then send a duplicate non-scheduled message, the non-scheduled message gets dropped. Similarly, if you send a non-scheduled message and then a duplicate scheduled message, the scheduled message is dropped."

Given the duplicate detection window, what timestamp of the scheduled message is considered? Is it the enqueue time or the scheduled time? Eg. I can schedule a message out at 5PM with ScheduledEnqueueTime = 5:15PM. Does duplicate detection apply at 5PM or 5:15PM? This is important because if the scheduledTime is a lot bigger than the duplicate detection window, then the duplicated scheduled message won't be dropped.

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
653 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Shireesha Eeraboina (Quadrant Resource LLC) 570 Reputation points Microsoft Vendor
    2024-11-15T17:29:57.3666667+00:00

    Hi @Catherine Du ,

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    According to the official Azure Service Bus documentation, scheduled messages are included in duplicate detection. The duplicate detection window starts from the time the message is enqueued and lasts for the duration specified by the user. Therefore, if you send a scheduled message and then send a duplicate non-scheduled message, the non-scheduled message gets dropped. Similarly, if you send a non-scheduled message and then a duplicate scheduled message, the scheduled message is dropped.

    Regarding your question, the duplicate detection applies to the scheduled message at the time it is enqueued, not at the scheduled time. So, in your example, if you schedule a message to be enqueued at 5:15 PM and the duplicate detection window is set to 5 minutes, any duplicate message sent between 5:15 PM and 5:20 PM will be dropped.

    I hope this helps! Let me know if you have any other questions.

    Thankyou.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.