Search code examples
azureazureservicebusazure-servicebus-queues

Difference between Azure service bus message time to live vs scheduled enqueue time?


I'm having a little trouble understanding the difference between a message that has a scheduled message time ('scheduledEnqueueTime') and the time to live (default 14 days).

What's the difference between the them? I'm understanding it as the longest time that I can put something on the queue before it wakes up and does a dequeue is 14 days (default). Is this incorrect?

FYI - In my app I need to place messages on the queue to wake up, in some cases, up to 60 days from the current day. I see I can increase the pricing tier of the service bus to standard pricing and that will increase the time to live. Is this what I need to do?


Solution

  • Time to Live is the duration until ServiceBus will discard the message if nobody processed it.

    With Scheduled Enqueue Time you can hide the message so nobody can process the message until you want it to. This is independent from the time to live.

    Scheduled messages do not materialize in the queue until the defined enqueue time

    Sidenote: You can also "defer" messages, but you have to explicitly unlock these messages from the queue. Scheduling would be better for your case.