Radu Olteanu
Radu Olteanu

Reputation: 443

Extend the initialVisibility Delay for an existing CloudQueueMessage for Azure Message Queue

I am trying to achieve the following flow using Azure Message Queue as illustrated in the following diagram :

enter image description here

So, the client initially creates and adds a message in the queue with initialVisibiltiyTimeout of 5 minutes.

_queueResolver.GetQueue("my-queue")
                          .AddMessage( new CloudQueueMessage(json), initialVisibilityDelay: TimeSpan.FromMinutes(5));

The challenges that I encountered so far are related to the ability to extend the initialVisibilityDelay period for the initial message that has been sent. I am not sure how can I retrive the message from the queue. What are the best practices in this cases ? Do I need to persist in other store the id's of the messages that are on the Queue ?

Upvotes: 2

Views: 1008

Answers (1)

Gaurav Mantri
Gaurav Mantri

Reputation: 136196

Unfortunately it is not possible to fetch a message set with initial visibility delay until the time that visibility delay has elapsed. The message will automatically appear in the queue after that time. Furthermore Azure Storage Queues does not allow you to fetch a message by message id.

I guess all you can do is list messages in GET mode (essentially dequeue messages), find the matching message's id and then make it invisible again by changing its visibility timeout property.

Upvotes: 1

Related Questions