Messages not consumed from SQS queue
Type: Bug
Component: SQS
Describe the bug I have @SqsListener configured in one of the method of my spring @Service class. I am using version of spring-cloud-aws-messaging 2.2.6.RELEASE At times ( very rarely ) I see that messages in the queue is not getting consumed. The listener method is not even invoked.
I had to bounce our spring boot container process to fix the issue. There is nothing in the logs with respect to errors. As of now using only the default configuration and not customized task executor or SimpleMessageListenerContainer bean. Unable to reproduce the issue in test environments. Could you please suggest what could be wrong here and how I can troubleshoot this issue ?
Sample @SqlListener(value="${queue.name}", deletionPolicy=SqsMessageDeletionPolicy.ON_SUCCESS) { ... }
I have this same issue. First time using this library though, so I have no idea if its a config issue or an actual bug. Nobody has replied to anything ive posted
Also, I have the same issue too
I still have this issue. We are bouncing the container process when we come across this issue. Any inputs would help.
@manjian14 @vijayrcse do you use the latest 2.4.2 version? There were many fixes in SQS integration since 2.2.6. Also, I am not able to reproduce this issue so if you could send a sample project with instructions how to reproduce it would be great.
I use 2.2.6.RELEASE. I tried to reproduce this issue in lower environment, but we couldn't. We could upgrade to 2.4,2 and see if this issue exist
Sounds good to me!
2.2.6.RELEASE working fine, when I upgraded to the latest version '2.4.2' sending a message within SQS is working but is not getting consumed. The listener method is not invoked, my code changes between the old and latest version is the change the used package, and removes the SQS enable annotations because that was deprecated
@manjian14 can you share a sample that reproduces it? We have a sample how to use SQS https://github.com/awspring/spring-cloud-aws/tree/2.4.x/spring-cloud-aws-samples/spring-cloud-aws-sqs-sample
Thank you, I tried your sample, and in the fact, my Implementation is very simple, just send and receive a message within SQS, only the changes which I have done after moving from 2.2.6.RELEASE to 2.4.2 is to create SQS Bean because SQSEnable was deprecated, and my SQS Bean is also simple, I don't use any credentials at the code level, because my project gets access to sqs by aws roles, my spring-boot version is 2.7.3 / Java 11
@manjian14 did it work after upgrade? If not, maybe there is a permission problem or the queue does not exist? I'd need more details to figure the root cause.
after upgrade, sending a message via sqs is working, but not consumed to the listener, I don't think it's related to AWS permission because the older version working fine and with the latest version I am able to send a message
the only major change is I replaced this he EnableSqs annotation with my own bean
@Bean public AmazonSQSAsync amazonSQSAsync(){ return AmazonSQSAsyncClientBuilder.standard().withRegion(Regions.US_EAST_1).build();
}
Unfortunately I cannot reproduce it. Please create a repository with minimal example that reproduces this issue.
I figure out something if I added @EnableSqs " which is deprecated" the latest lib 2.4.2 start work, otherwise, if I remove the EnableSqs , the code not consuming to the listener
Then it means that for some reason the autoconfiguration is not triggered. Run application with debug mode (debug=true in application.properties and look for SqsAutoConfiguration).
Thank you, the issue has been fixed, the problem was related to autoconfiguration dependency
Awesome!
@vijayrcse are you guys working together or do you have a separate issue? If so, can you also verify that it is not an autoconfiguration problem?
nop, this is a separate issue, but I believe is the same reason
Issue raised by @manjian14 is a separate issue. Original issue reported by me on 2.2.6 still remains. We are looking at upgrading to 2.4.2 sooner
Hey @maciejwalkowiak, maybe we can close this one in hopes that it won't happen in 3.0? Even if the problem did appear, I don't think info from this thread would be helpful. WDYT?