I using Azure Storage Queues for handle my items processing flow. Tasks are getting into the queue, Being processed by the background server and removed from the queue.
In some cases, the processing of some task is failed (due to environmental variables - which can't be expected). In this case, I want to retry the execution of the task again. If this time the processing was fine, everything is good - just remove it from queue. Otherwise, remove it from queue and write some message to the log.
So, I'm looking for some mechanism to add meta-data to CloudQueueMessage item. I'm thought about a new meta-data called 'retries'. Which will be a counter. But I'm don't see any option to add meta-data to a queue item.
Another option is to wrap my item with Wrapper class that will add 'retries' property. After dequeue the item from the queue, re-insert it with modified 'retries' value. This should work but, not an elegant solution.
What is your recommendations?