Service Bus Message

Lucas Lindfors 0 Reputation points
2023-02-27T08:02:31.95+00:00

I am trying to change the EnqueuedTimeUtc property of a service bus message to a queue, but it seems to be set to read-only. Is there any way to modify or create a message with the EnqueuedTimeUtc property set to what I want?

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

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 70,016 Reputation points
    2023-03-01T07:53:22.5866667+00:00

    @Lucas Lindfors Thanks for reaching out. You can only get the EnqueuedTimeUtc property when the message is already send to the entity (queue/topic). You can only Schedule the enqueue time when you send the message to the entity by levering the ScheduledEnqueueTimeUtc on the message you are about to send.

    In case if your message is already send to the entity then you need to peek the message first (if you know the sequence number then peek only that message using sequence number) and resend the message again with the same property of the peeked message and updating the ScheduledEnqueueTimeUtc to the new time and it creates a new message with the new message ID.

    If you are sending a new message then make sure you are setting the ScheduledEnqueueTimeUtc property of the message before sending it.

    Feel free to get back to me if you need any assistance.

    Please accept as "Yes" if the answer is helpful so that it can help others in the community. If you need any help/clarification/concerns/follow up questions, then please click on "Add Comment" on my answer and provide more details.

    0 comments No comments