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

Support for sending and receiving large message in SQS #858

Open
vijayrcse opened this issue Aug 4, 2023 · 9 comments
Open

Support for sending and receiving large message in SQS #858

vijayrcse opened this issue Aug 4, 2023 · 9 comments
Labels
component: sqs SQS integration related issue type: enhancement Smaller enhancement in existing integration
Milestone

Comments

@vijayrcse
Copy link

Type: Feature

Is your feature request related to a problem? Please describe.
We have a use case where our message size is larger than 254kb. is there a support in spring-cloud-sqs-messaging to send and receive large size messages using SQS extended client library

@tomazfernandes
Copy link
Contributor

Hi @vijayrcse, thanks for bringing this up.

It should be possible to send larger messages by using S3 to store the payload, and sending only the reference in the message

There's a java-extended-client-lib that has this feature built in, as described here

Unfortunately it implements the blocking SqsClient, which is not supported by the framework. It might be possible to create an adapter or wrapper to use it with the SqsTemplate.

Let me know how it works for you.

Thanks.

@tomazfernandes tomazfernandes added component: sqs SQS integration related issue status: waiting-for-feedback Waiting for feedback from issuer labels Aug 24, 2023
@NightFox7
Copy link

Hello !
I am also interested. I cannot find a way to make the extended client work the spring cloud aws sqs.
Can anyone provide some tips please ?
Thanks in advance;

@tomazfernandes
Copy link
Contributor

Hi @NightFox7, if anyone is interested in creating a prototype of an adapter to use the client I linked above, or a separate implementation, I'd be happy to take a look.

@vijayrcse
Copy link
Author

We used SQS Extended client library to publish the message to the queue. We didn't use SQStemplate of spring cloud aws
However on the consumer side, we still use the SQSListener to consumer the message as string and process. If the message size is greater than 254kb, the message will have a link to the S3 bucket. Within the listener implementation we check for a specific header( it will be only available if the message is in greater than 254 kb ) and based on that we have conditional logic to retrieve the actual message from s3 reference.

@NightFox7
Copy link

Ok I see. Thank you @vijayrcse

@tomazfernandes tomazfernandes added the type: enhancement Smaller enhancement in existing integration label Jan 5, 2024
@outcomes-josef-salyer
Copy link

@vijayrcse do you have an example of your workaround that you can share?

@vijayrcse
Copy link
Author

hi @outcomes-josef-salyer , we referred only java-extended-client-lib. You will find example code snippets in AWS documentation

@agarcia-te
Copy link

agarcia-te commented Sep 3, 2024

Unfortunately it implements the blocking SqsClient, which is not supported by the framework.

@tomazfernandes I believe async support has been added to the amazon-sqs-java-extended-client-lib, is this what you mean? https://github.com/awslabs/amazon-sqs-java-extended-client-lib/releases/tag/2.1.0

https://github.com/awslabs/amazon-sqs-java-extended-client-lib/blob/07d988c424dea7e4e7d128b217182e1414310560/src/main/java/com/amazon/sqs/javamessaging/AmazonSQSExtendedAsyncClient.java#L78

@tomazfernandes
Copy link
Contributor

Looks like it @agarcia-te!

I wonder what we we'd need to do here to support that though, maybe the user can simply declare such client as a bean and the framework would use it?

@maciejwalkowiak maciejwalkowiak removed the status: waiting-for-feedback Waiting for feedback from issuer label Sep 18, 2024
@maciejwalkowiak maciejwalkowiak added this to the 3.3.x milestone Sep 18, 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 type: enhancement Smaller enhancement in existing integration
Projects
None yet
Development

No branches or pull requests

6 participants