Expose current retry count in the context of the function
See original GitHub issuePer the new retry feature rolling out, one scenario that is desired is the ability to deadletter / capture something that is on its final retry. For example, if I have an event hub triggered function and define a retry policy of 5, on the 5th retry if it fails I want to catch that failure and store it in a deadletter queue or something so I can go inspect it later. However, today the context for the current retry count isn’t surfaced directly, and using something like a local variable to increment may be tricky when multiple executions could be executing / retrying on the same host.
Proposal is that there is a new context passed into the ExecutionContext
that includes information on the retry.
try
{
}
catch()
{
if(context.retries.count >= context.retries.max)
{
// deadletter
}
throw exception;
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Azure spring boot function - get current retry count
question is how do we get current retry count? I need to copy message to failed queue after 3 unsuccessful retry, could not...
Read more >Working with Polly – Using the Context to Obtain the Retry ...
In this post, we'll explore a use for the Polly Context object to share data between our code and the execution of a...
Read more >Retry guidance for Azure services
If the specified retry count is exceeded, the results are wrapped in a new exception. It doesn't bubble up the current exception. Policy ......
Read more >Handling errors in Durable Functions (Azure Functions)
In this article. Errors in activity functions; Automatic retry on failure; Custom retry handlers; Function timeouts; Unhandled exceptions; Next ...
Read more >Test Retries | Cypress Documentation
With test retries, Cypress is able to retry failed tests to help reduce test flakiness and continuous ... currentRetry returns the current test...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Moving comment from @casper-79 here: https://github.com/Azure/azure-functions-java-library/issues/132#issuecomment-721812596
All we’re doing is taking in a JSON request from an external source and storing it. Theres really not much to it. After reading, it sounds like that’s not in-proc though.