JobHost.RunAndBlock not blocking

1.6k views Asked by At

I have implemented a long running process as a WebJob which is triggered upon a queue message. My understanding is that JobHost.RunAndBlock() would only start executing once the current job has completed and returned. However, if my first process is still running when another queue message arrives, a second process starts executing and trashes the first process (which has some static data structures).

1

There are 1 answers

0
Victor Hurdugaci On BEST ANSWER

By default, queue messages are processed in parallel. The default degree of parallelism is 16.

If you don't want parallel execution, you can set the JobHostConfiguration.Queues.BatchSize to 1, as described here.