Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a configurable retry policy for Kafka triggered functions #122

Closed
mcollier opened this issue Mar 22, 2020 · 9 comments
Closed

Provide a configurable retry policy for Kafka triggered functions #122

mcollier opened this issue Mar 22, 2020 · 9 comments
Labels
enhancement New feature or request

Comments

@mcollier
Copy link
Contributor

As a developer,
I would like the ability to optionally configure a retry policy when the triggered function fails,
so that a failed execution does not automatically advance the cursor.

This feature should work for all GA supported Azure Functions languages.

There is a similar issue for the Event Hub extension. The expectation is that the Event Hub and Kafka extension work in a similar manner related to retries. Please see the discussion at Azure/azure-webjobs-sdk#1597 and the sample at https://github.com/jeffhollan/retry-design.

@maxbog
Copy link

maxbog commented Oct 30, 2020

Hi @mcollier. Is this something that is being worked at?

@mcollier
Copy link
Contributor Author

mcollier commented Nov 5, 2020

@maxbog I don't have any insights on specific work for the Kafka extension.

FYI - There is now a retry policy for function triggers; see https://docs.microsoft.com/azure/azure-functions/functions-bindings-error-pages?tabs=csharp#retry-policies.

@maxbog
Copy link

maxbog commented Nov 7, 2020

@mcollier I saw those annotations, but from this issue I understand that they need some code in the kafka trigger to be supported, right? What I'm looking for is a retry on an exception without advancing the cursor.

As far as I know, right now even if an exception occurs in the function code, the kafka cursor will go forward.

Maybe I could help here and submit a PR based on how it's implemented in the Event Hubs trigger? I saw a PR on the EH repo, which is not merged yet: Azure/azure-functions-eventhubs-extension#56

@maxbog
Copy link

maxbog commented Nov 8, 2020

I just read some code in the Azure/azure-webjobs-sdk#2463 PR and for me it seems that there is nothing required on the kafka extension to support the retries.

@mcollier Can you confirm that the Retry attributes will work without any changes to this repo?

@TsuyoshiUshio
Copy link
Contributor

Hi @maxbog

I talked with the author of the Azure/azure-functions-eventhubs-extension#56 . He said that the PR should be closed since he imiplemented it on webjobssdk side. We can use the retry feature for the Kafka as well. I'll test it and confirm if it works. However, in theory, it should work. :)

@TsuyoshiUshio
Copy link
Contributor

Hi @maxbog and @mcollier
It works for Kafka Trigger as well, however, the issue is, the retry is supported on Microsoft.Azure.WebJobs 3.0.23. I need to update the version. I'll do it soon. Before that, you can add WebJobs on your csproj file. I'll upgrade the kafka version to fit 3.0.23 soon.

     <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Kafka" Version="3.1.2" />
     <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.10" />
    <PackageReference Include="Microsoft.Azure.WebJobs" Version="3.0.23" />

@TsuyoshiUshio
Copy link
Contributor

Hi @maxbog @mcollier
I have an update. The Microsoft.NET.Sdk.Functions is updated. It includes WebJobs 3.0.23 So we can go with

     <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Kafka" Version="3.1.2" />
     <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.11" />

@paulbatum
Copy link
Member

Retry policies now require each trigger to opt-in (because many triggers already have built-in retries) so there is still some work to do here for the Kafka extension to add retry support.

@shrohilla
Copy link
Contributor

This is supported in 3.5.0 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants