Azure Queues: Enqueue a message periodically from only one worker role instance -


i want task periodically (per day) on our web/worker role. have multiple instances in cloud service, , want 1 of these instances task per day (for example instance0 can 1 day, next day instance1 doing work, 0 , 1 not try same work during same day/period)

azure queues seem great way achieve because design 1 instance dequeue message (assuming deletes after doing work).

what having trouble figuring out way put 1 copy of message in queue per day. way have figured enqueuing message every day azure scheduler jobs.

my problem azure scheduler fact need create job every single storage account have across of deployments.

is there way within cloud service, without taking scheduler dependency?

if don't want have scheduler dependency, consider using blob leases semaphore of sorts. http://justazure.com/azure-blob-storage-part-8-blob-leases/

at time of day, have worker instances compete lease on central storage blob. whoever gets lease, prevents other instances getting lease , can queue messages queue.

having said that, why afraid of scheduler dependency? have kick off single job queue "start work" message. have instances monitor queue. whoever picks message, can run thru of storage accounts , queue individual storage-work messages instances pickup.


Comments