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

fix(#1583): Call AbandonMessageAsync on Azure Service Bus message when persistence fails to avoid message loss #1584

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

oussama-smida
Copy link
Contributor

Description:

When using Azure Service Bus, messages are marked as completed even if the system fails to persist the received message to the database.

Issue(s) addressed:

Changes:

  • Call AbandonMessageAsync on Azure Service Bus message when persistence fails to avoid message loss.

Affected components:

  • DotNetCore.CAP.AzureServiceBus

Checklist:

  • I have tested my changes locally
  • I have added necessary documentation (if applicable)
  • I have updated the relevant tests (if applicable)
  • My changes follow the project's code style guidelines

…essage when persistence fails to avoid message loss
@mviegas
Copy link
Contributor

mviegas commented Sep 17, 2024

MS Docs have the following remark about the AutoCompleteMessages property of the SB processor:

If the message handler triggers an exception and did not settle the message, then the message will be automatically abandoned, irrespective of AutoCompleteMessages.

Still, what you proposed here makes sense as the OnMessageCallback catches exceptions, which causes the processor to think that messages were handled successfully.

LGTM.

@mviegas mviegas self-requested a review September 17, 2024 14:02
@yang-xiaodong yang-xiaodong merged commit 7e9d668 into dotnetcore:master Sep 18, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants