user145610
user145610

Reputation: 3025

WebJob Message submittion always goes to poison queue rather than actual Queue

We are using Webjob latest SDK for our web job, we see weird behavior that some time our queue messages goes to poison queue rather than actual queue. I don't find any error in webjob dashboard also. Has any one faced this kind of issue.

public async static Task  ProcessQueueMessage( [QueueTrigger("%QueueName%")] Parameter message, int dequeueCount, TextWriter log )
{
    try
    {
    //read parameters
    //perform db operation last for 2-5 mins
    }
    catch
    {
    }
}
public static void BindToPoisonQueue( [QueueTrigger("QueueName-poison")] parameter message, TextWriter log )
    {
        log.Write("Problem with message: " + message);
    }

I don't find issue with code, but not sure why messages automatically redirected to poison queue instead of actual queue.

Upvotes: 0

Views: 503

Answers (1)

mathewc
mathewc

Reputation: 13558

The SDK only moves a message to the poison queue if it has failed processing a number of times greater than the retry count configured via JobHostQueuesConfiguration.MaxDequeueCount. Check the message details - it might be that the message body is failing to deserialize into your Parameter POCO Type.

Also, please recheck your Dashboard - each time a function fails, you'll get a "Failed" entry with the details. I just verified this myself, in a case where the function fails because the message fails deserialization.

Upvotes: 1

Related Questions