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

[BUG] Spring Cloud Stream Service Bus delivers a message sometimes twice #43428

Open
mlohmeyer opened this issue Dec 16, 2024 · 3 comments
Open
Assignees
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone

Comments

@mlohmeyer
Copy link

Describe the bug
Last Month we had 6000 cases (out of 5 Mio), where a Message gets delivered twice with Spring Cloud Stream Service Bus.

  • The message stays for the Timeout in the Queue (2 Min, thats the minor problem)
  • Then we process the message and complete it
  • Then the message gets delivered again. (after another 2,8 mins)
  • Then Spring Cloud Stream Azure is doing a renewMessageLock which fails, becuase the message is already completed
    But thats an internal exception, thus we process the message again. That the major problem.
    At the End complete fails, because the message is already processed.
  • the error happens at arbitrary time. Not only on high Load on service Bus (Premium) and Container App.

Exception or Stack Trace
com.azure.messaging.servicebus.ServiceBusException: The lock supplied is invalid. Either the lock expired, or the message has already been removed from the queue. For more information please see ...

To Reproduce
unclear

Expected behavior
A Message get delivered only one time.

Screenshots

Image

** Logs **

Logs from Service Bus Side (From Azure Support Ticket)
Message sent to queue | 0:12:01:01.529093
First delivery (msg lock) | 0:12:01:01.529272
Abandoned | 0:12:03:01.520244
Second delivery | 0:12:03:01.530253
Completed Successfully | 0:12:03:02.480113

what we can see in the application Insights Logs (100% of all logs are saved in Insight at that time)
first processing    on 2024-11-28T12:03:01.527Z (UTC)
complete         on 2024-11-28T12:03:02.366Z (UTC)
second processing on 2024-11-28T12:05:48.082Z (UTC) why?

**Setup **

  • OS: Linux Docker Image
  • Library/Libraries:
    spring-messaging-azure-4.15.0,
    spring-messaging-azure-servicebus-4.15.0
    spring-cloud-azure-stream-binder-servicebus-4.15.0
    spring-cloud-stream-4.0.3
    spring-boot-3.1.5
  • Java version: 17
  • App Server/Environment: Azure Container Apps
  • Frameworks: Spring Boot

Information Checklist

  • [ x ] Bug Description Added
  • [ x ] Repro Steps Added
  • [ x ] Setup information Added
@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Dec 16, 2024
@saragluna saragluna added this to the 2025-01 milestone Dec 16, 2024
@moarychan
Copy link
Member

Hi @mlohmeyer ,

Thanks for using Spring Cloud Azure~

Please double check the versions you used, the version combination Spring Boot 3.1.5 + SCA Service Bus Binder 4.15.0 is not compatible; if you are using Spring Boot 3.1.5, SCA Service Bus Binder version should be 5.x. And could you provider a minimal project to reproduce the issue?

@akhudairymicrosoft
Copy link

Hi @moarychan , sample code and pom file were shared with you over email

@mlohmeyer
Copy link
Author

Hi @moarychan we will upgrade to SCA Service Bus Binder 5.19.0, but it will lasts until mid on January because of cristmas holiday until we will get it productive.

@moarychan moarychan moved this from Todo to In Progress in Spring Cloud Azure Dec 20, 2024
@saragluna saragluna modified the milestones: 2025-01, 2025-02 Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
Status: In Progress
Development

No branches or pull requests

4 participants