awslabs / amazon-sqs-java-extended-client-lib

An extension to the Amazon SQS client that enables sending and receiving messages up to 2GB via Amazon S3.
Apache License 2.0
211 stars 109 forks source link

Split batches which would go over the threshold #44

Open ashleyfrieze opened 4 years ago

ashleyfrieze commented 4 years ago

An alternative fix for #24

Where in PR #37 we tried the solution of moving messages to S3 when the batch was too large, this has a disadvantage that there can be 11 overall calls to AWS SQS & S3 to deal with a batch.

This solution takes the approach of splitting the batch after the oversized messages have been pushed to S3. This may result in several batches being sent to SQS, and it requires merging send batch results together as well as manipulating the send batch request. However, it has two advantages:


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.