Is there a time limit for scheduled messages in Azure Service Bus?

Nathã Azevedo 0 Reputation points
2024-01-23T19:24:21.53+00:00

Looking at the Azure Service Bus documentation we can see that it is possible to schedule messages:

Schedule a message We can schedule a message to be enqueued at a later time. The message won't be able to be received until that time, though it can still be peeked before that. We get back the message sequence number which can be used to cancel the scheduled message.

  long seq = await sender.ScheduleMessageAsync(     message,     DateTimeOffset.Now.AddDays(1));

You can also schedule a message by setting the ScheduledEnqueueTime property on the message and using the SendMessageAsync or SendMessagesAsync methods. The difference is that you won't get back the sequence number when using these methods so you would need to peek the message to get the sequence number if you wanted to cancel the scheduled message.

Is there a time limit in which we can schedule a message? for example DateTimeOffset.Now.AddMonths(6) aur DateTimeOffset.Now.Add Month(12) is it possible?

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
700 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Silvia Wibowo 6,046 Reputation points Microsoft Employee Volunteer Moderator
    2024-01-24T01:47:36.2633333+00:00

    Hi @Nathã Azevedo , I understand you want to know the maximum time you can set for schedules messages in Azure Service Bus.

    Looking at these 2 entries in GitHub issues:

    1. https://github.com/Azure/azure-service-bus-go/issues/103
    2. https://github.com/MicrosoftDocs/azure-docs/issues/67357

    I can conclude that there is no limit from server side.

    Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.

    0 comments No comments

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.