-
-
Notifications
You must be signed in to change notification settings - Fork 302
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 not working after upgrading to Spring Boot 3.1.3 #914
Comments
You're mixing Spring Cloud AWS 2.x with 3.x. If you're using Spring Boot 3, you must use Spring Cloud AWS 3.x. I am using SQS integration with Spring Boot 3.1.4 so definitely unless there is some unusual config, it does work as expected. Please try adjusting dependencies and let us know if it helped. |
Thank you so much for the reply @maciejwalkowiak. Understood. I have updated my code: Configuration:
Code to sendMessage:
Code to receive message:
I have imported this SqsBootstrapConfiguration.class as well in the Configuration class. I am able to send the message to the queue but i have this error: org.springframework.messaging.converter.MessageConversionException: Could not read JSON: Cannot construct instance of Anything else is incorrect or anything else i am missing?? Thank you so much!!! Juliana |
I find it difficult to go through your code samples, formatting could be one of the reasons. Also, Are you able to publish a complete project that reproduces your issue? Something I can checkout and run myself? |
Thank you for the reply @maciejwalkowiak. Just updating here with my latest status. I had this dependency on my pom file: I removed and added: I see that the Listener container has started successfully now: I dont see that exception anymore. However, i have this one exception for the token: 11:13:52.722 ERROR --- [nc-response-0-0] i.a.c.s.o.AbstractMessagingTemplate : Error sending message 90593638-c193-7a72-230c-85614f6c7d6a to endpoint http://localhost:9324/000000000000/standard io.awspring.cloud.sqs.operations.MessagingOperationFailedException: Message send operation failed for message 90593638-c193-7a72-230c-85614f6c7d6a to endpoint http://localhost:9324/000000000000/standard ..... Caused by: software.amazon.awssdk.services.sqs.model.SqsException: The security token included in the request is invalid. (Service: Sqs, Status Code: 403, Request ID: 4c1d683e-87b8-5c5e-817e-358db548edfe) This is my sqsClient:
|
And i see this error: The Canonical String for this request should have been amz-sdk-invocation-id:5c407020-847c-c2a7-c4bc-86917bfee56e amz-sdk-invocation-id;amz-sdk-request;content-length;content-type;host;x-amz-date The String-to-Sign should have been |
@maciejwalkowiak we found the issue. The host was set to the real server, when we overwrite, it works fine. Thank you for your help. You can close this issue. |
Uff super happy you found it! I am closing it then! |
@maciejwalkowiak Thank you for kindness answering for us. Do you happen to have any documents for migrating 2.X to 3.X version related to |
Type: Bug
Component:
SQSDescribe the bug
Please provide details of the problem, including the version of Spring Cloud that you
are using.
After upgrading to Spring Boot 3.1.3, @SqsListener is not working anymore. My service is able to send a message to SQS queue but is not receiving the message. I have been trying to fix for more than 3 weeks now, but cant seem to figure this out.
Can someone please help me figure out what is missing?? Thank you!!!!
Note that the code below is for local testing. With Spring Boot 2.x it works fine.
This is my Configuration code, in the Configuration class:
This is the sendMessage code in the Service class.
This is the listener code:
These are the AWS dependencies in the pom file:
When i run the application with debug mode, i see this:
SqsAutoConfiguration matched:
- @ConditionalOnClass found required classes 'software.amazon.awssdk.services.sqs.SqsAsyncClient', 'io.awspring.cloud.sqs.config.SqsBootstrapConfiguration' (OnClassCondition)
- @ConditionalOnProperty (spring.cloud.aws.sqs.enabled=true) matched (OnPropertyCondition)
SqsAutoConfiguration#defaultSqsListenerContainerFactory:
Did not match:
- @ConditionalOnMissingBean (types: io.awspring.cloud.sqs.config.SqsMessageListenerContainerFactory; SearchStrategy: all) found beans of type 'io.awspring.cloud.sqs.config.SqsMessageListenerContainerFactory' defaultSqsListenerContainerFactory (OnBeanCondition)
SqsAutoConfiguration#sqsAsyncClient:
Did not match:
- @ConditionalOnMissingBean (types: software.amazon.awssdk.services.sqs.SqsAsyncClient; SearchStrategy: all) found beans of type 'software.amazon.awssdk.services.sqs.SqsAsyncClient' sqsAsyncClient (OnBeanCondition)
SqsAutoConfiguration#sqsTemplate:
Did not match:
- @ConditionalOnMissingBean (types: io.awspring.cloud.sqs.operations.SqsTemplate; SearchStrategy: all) found beans of type 'io.awspring.cloud.sqs.operations.SqsTemplate' sqsTemplateManualContainerInstantiation (OnBeanCondition)
In addition to that, when i check the QueueUrl, i see this:
Sample
If possible, please provide a test case or sample application that reproduces
the problem. This makes it much easier for us to diagnose the problem and to verify that
we have fixed it.
The text was updated successfully, but these errors were encountered: