How do I handle large messages in AWS SQS using the SQS Extended Client Library for Java?

1.7k Views Asked by At

I know that SQS can handle messages larger than 256kb, using the Java extended client library, but what's confusing me is where does this go? Do I upload it as a separate app?

1

There are 1 best solutions below

0
On

You include it in the producer & the consumer - the library then automatically handles:

  • Stores your large message in S3
  • Sends a message onto the queue, that contains the URL
  • Retrieves the (message) object from the S3 bucket based on the URL
  • Deletes the (message) object from an S3 bucket

It is an extra dependency, that you can manage using a variety of dependency management tools.

For example, if you're using Maven:

<dependency>
  <groupId>com.amazonaws</groupId>
  <artifactId>amazon-sqs-java-extended-client-lib</artifactId>
  <version>2.0.2</version>
</dependency>

Or if you're using Gradle:

implementation 'com.amazonaws:amazon-sqs-java-extended-client-lib:2.0.2'