jeffhollan / functions-csharp-queue-exponential

Example of doing exponential backoff for queue triggered functions
5 stars 2 forks source link

Does this work for an http trigger writing to a service bus queue? #2

Open SoucianceEqdamRashti opened 4 years ago

SoucianceEqdamRashti commented 4 years ago

Hello,

Does the code also work for when you have an http trigger and your output binding is a service bus binding and you are returning a response back to the http caller?

From our attempts (when we deliberately set the queue to receive disabled for testing) it seems that the retry doesn't work because somehow the process returns the response back to the caller before the retry part even kicks in? I am thinking if it works in this case because if you have the message.Complete part?

Thanks

SoucianceEqdamRashti commented 4 years ago

It does not seem like it will work because we are also trying to repond back to the http caller. Or?

sudeeps99 commented 4 years ago

6-2020 11:02:22] Executing 'ExponentialRetry' (Reason='', Id=02d36b62-6227-43c5-995d-f6633f88f262) [26-06-2020 11:02:22] Trigger Details: MessageId: fb0cd8c50601494fa73d5bcbd5071e22, SequenceNumber: 174, DeliveryCount: 1, EnqueuedTimeUtc: 2020-06-26T11:02:22.3580000Z, LockedUntilUtc: 2020-06-26T11:02:52.3730000Z, SessionId: (null) [26-06-2020 11:02:22] C# ServiceBus queue trigger function processed message sequence #174 [26-06-2020 11:02:23] Some exception [26-06-2020 11:02:23] functions-csharp-queue-exponential: Some exception. [26-06-2020 11:02:23] Calculating exponential retry [26-06-2020 11:02:55] Scheduling message retry 1 to wait 5 seconds and arrive at 26-06-2020 11:02:51 [26-06-2020 11:03:04] Executed 'ExponentialRetry' (Succeeded, Id=02d36b62-6227-43c5-995d-f6633f88f262) [26-06-2020 11:03:22] Executing 'ExponentialRetry' (Reason='', Id=f2fb13f9-1106-4b0c-ae69-8089ed4a9950) [26-06-2020 11:03:22] Trigger Details: MessageId: fb0cd8c50601494fa73d5bcbd5071e22, SequenceNumber: 174, DeliveryCount: 2, EnqueuedTimeUtc: 2020-06-26T11:02:22.3580000Z, LockedUntilUtc: 2020-06-26T11:03:51.9790000Z, SessionId: (null) [26-06-2020 11:03:22] C# ServiceBus queue trigger function processed message sequence #174 [26-06-2020 11:03:22] Some exception [26-06-2020 11:03:22] functions-csharp-queue-exponential: Some exception. [26-06-2020 11:03:22] Calculating exponential retry

The retry count is not incrementing this example is running in loop.

What is the issue?