0
votes

I have developed Azure worker role to do some task. This worker role also configured to auto scale based on a queue. Every thing is working fine.

My Issue is when the worker role is scale down, worker role shuts down before completing the current task. Due to this issue some tasks may partially completed.

Can anybody suggest me a solution for this issue ?

Thank you in advance.

1

1 Answers

2
votes

The typical solution to this is that the worker should not delete the message from the queue until after it has been properly handled. This is a reliability mechanism because any worker could technically go offline at any time (e.g., a hardware failure). If the message in the queue isn't deleted until processing is complete, then the worker role shutdown isn't going to impact reliability because the message will reappear in the queue after your configured timeout.