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

SQSListener scales even if i manually set sync working #1116

Open
VladislavKutsobin opened this issue Mar 25, 2024 · 1 comment
Open

SQSListener scales even if i manually set sync working #1116

VladislavKutsobin opened this issue Mar 25, 2024 · 1 comment
Labels
component: sqs SQS integration related issue status: waiting-for-feedback Waiting for feedback from issuer

Comments

@VladislavKutsobin
Copy link

VladislavKutsobin commented Mar 25, 2024

Type: Bug

Component: SQS

Describe the Bug
Hello!

Please, help me understand what i do wrong.
I apologize i can't share with you stack trace because the code under nda. I will try describe the problem:
I use 'spring-cloud-aws-starter-sqs' dependency, version 3.0.1. My configuration is auto (i don't define any beans - only credentials and region in application.properties).
Next, i use SqsListener like:
@SqsListener(value = "${sqs.balance.calculator}", maxConcurrentMessages = "1", maxMessagesPerPoll = "1")

So my main goal is correct calculation. Optimization is not important in my case. So i would my listener works sync.
I must do that because inside the method i adjust the same entity, and if i do it async - i have a lot of optimistic blocking exception.

But, the main reason why i write this issue is: Sometimes i catch errors: [Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect)]

And it mean that somewhere occurs autoscaling. But why, what i can do wrong?

Thanks!

@tomazfernandes
Copy link
Contributor

Hi @VladislavKutsobin, sorry for the delay.

Are your instances autoscaling? If you have more than one server instance it will consume more than one message at a time.

Hard to say anything without more information. Perhaps message visibility is expiring?

It would be helpful if you could take a look at your logs. If there's a log in the end of message consumption, and one at the end, you should be able to see whether two messages are being consumed concurrently, or if there's anything else causing the issue.

Make sure to log some instance identifier and any other useful information.

Another option is - if you can create a minimal project that reproduces the issue I could take a look.

Thanks.

@tomazfernandes tomazfernandes added component: sqs SQS integration related issue status: waiting-for-feedback Waiting for feedback from issuer labels Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: sqs SQS integration related issue status: waiting-for-feedback Waiting for feedback from issuer
Projects
None yet
Development

No branches or pull requests

2 participants