About WA Queue message Invisibility timeout


  • Windows azure queues are often used to store messages which worker role instances will later use to process.

    Sometimes there will be messages which needs more time to process than normal messages, those messages will reappear in the queue after invisibility timeout.

    Normally, people will use UpdateMessage() to extend the invisibility timeout of such messages. But this is not robust to me, what if we could not precisely evaluate the extra processing time at the run-time?

    I wonder whether we could just record the message content and then delete the message once we retrieve it, and if the worker role fail to process it, we could just recover the message using the recorded content(Here, I mean constructing a new message with the recorded message content and putting it into the queue).

    Any potential harm to the above proposal? Whatever comment is welcome.


    Friday, January 4, 2013 3:21 AM


  • One downside of this approach is that after you delete the message but before your process is finished, the instance working on that process goes down for any reason. In that case, that particular process will never get done.

    One possible solution to your problem is to identify the processes which will take longer than normal and when you get messages for these processes make them invisible for a longer duration than normal messages.

    Hope this helps.

    Friday, January 4, 2013 6:08 AM