Hello @Manith singh,
Thank you for reaching out. Scheduled messages in Azure Service Bus using ScheduledEnqueueTimeUtc
are designed to become available for processing at the specified time. It’s important to note that these messages might not always be processed exactly at the scheduled time due to several factors. Azure Service Bus tries to deliver messages as close to the scheduled time as possible, but delays can happen because of high load on the queue, network latency, or how the receiving application is performing. There is no specific throttling applied to scheduled messages, but message delivery can still be slightly delayed if the system is under heavy usage or if the message processor is busy.
To reduce delays and improve the accuracy of scheduled message delivery, here are some best practices to follow:
- Optimize your message processor: Make sure your application is responsive and not blocked by long-running tasks. Use asynchronous message handling where possible.
- Avoid scheduling too many messages at once: If you’re scheduling a large number of messages, try to distribute them over time rather than enqueueing them all simultaneously.
- Keep the SDK updated: Use the latest version of the
Azure.Messaging.ServiceBus
SDK to benefit from performance improvements and bug fixes. - Use idempotent processing: Design your message handler so that it can safely process the same message more than once, in case of retries or slight delays.
- Monitor and log processing times: Track when a message is scheduled and when it's actually processed. This helps identify and diagnose delay patterns.
- Sync your system clock: Ensure your application servers have accurate time settings using NTP (Network Time Protocol), as scheduling is based on UTC time.
Kindly refer below links:
Best Practices for performance improvements using Service Bus Messaging
https://stackoverflow.com/questions/71842283/azure-service-bus-scheduled-message-arriving-too-late
Hope this helps. Do let us know if you any further queries.