I have a web-job that gets triggered by queue messages. If the job gets too long, The message reappears on the queue and a new instance of the web-job is triggered consuming the same message. That is not meant to be.
We want that message to be deleted from the message queue once the Job is triggered with that message.
We had set MaxDequeueCount = 1
, with the thought that It will try processing the message once and then message will be moved to Poison Queue. But MaxDequeueCount is not working for us. In our Job, We are using 8.7.0.0 version of Microsoft.WindowsAzure.Storage
.
Please help!
JobHostConfiguration config = new JobHostConfiguration();
config.NameResolver = new QueueNameResolver();
config.Queues.BatchSize = Convert.ToInt32(ConfigurationManager.AppSettings["BatchSize"]);
config.Queues.MaxDequeueCount = Convert.ToInt32(ConfigurationManager.AppSettings["MaxDequeueCount"]);
var host = new JobHost(config);
host.RunAndBlock();