question

PeterVelthuis-2359 avatar image
0 Votes"
PeterVelthuis-2359 asked PramodValavala-MSFT commented

QueueTrigger retry policy with durable function

Is it possible to use the default queue trigger retry policy (think it's five retries) when you kick off an orchestration using *StartNewAsync* ?
So the queue trigger function would just have one line of code: starter.StartNewAsync(..).

The issue is that startNewAsync returns when the orchestration has started, so underlying exceptions won't bubble back up to the trigger.
I know there are alternatives like starting an orchestration and have it in turn use CallSubOrchestratorWithRetryAsync with a custom retry, but it's hard to get the current retry number with that.



azure-functionsazure-queue-storage
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

PramodValavala-MSFT avatar image
0 Votes"
PramodValavala-MSFT answered PramodValavala-MSFT commented

@PeterVelthuis-2359 While a direct retry isn't possible, you could poll the status using the GetStatusAsync API and retry in code on failure. But with something like this, you need to ensure that everything runs within the function timeout otherwise the queue triggered function would just always fail.

Instead, another option would be to have your orchestrator send a failure queue message that triggers the retry while keeping count and logging exceptions.


· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@PramodValavala-MSFT
Can you give some more details or a link to documentation on how to send a failure queue message ?

Would the same strategy apply to event grid?

0 Votes 0 ·

@PeterVelthuis-2359 It just would be like any other message but with different payload/properties that you would process separately. The same can hold true for Event Grid but it would be best to send the Event Grid event into Service Bus directly and then use the same retry implementation.


0 Votes 0 ·