Skip to content

Batch by total request message size. #410

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

petermyers
Copy link
Collaborator

@petermyers petermyers commented Jun 4, 2025

Per the aws docs for SendMessageBatch:
The maximum allowed individual message size and the maximum total payload size (the sum of the individual lengths of all of the batched messages) are both 256 KiB (262,144 bytes).

  • Adds batching per request size in addition to the message count to the SQS sink.
  • Adds claimcheck support since batchWithSize already does most of the work and fromSqsEvent already redeems the claimchecks anyway.

@petermyers petermyers changed the title Batch to total request message. Batch to total request message size. Jun 4, 2025
@petermyers petermyers requested a review from jgilbert01 June 4, 2025 14:42
@petermyers petermyers changed the title Batch to total request message size. Batch by total request message size. Jun 4, 2025

export const sendToSqs = ({ // eslint-disable-line import/prefer-default-export
id: pipelineId,
debug = d('sqs'),
queueUrl = process.env.QUEUE_URL,
messageField = 'message',
batchSize = Number(process.env.SQS_BATCH_SIZE) || Number(process.env.BATCH_SIZE) || 10,
maxPublishRequestSize = Number(process.env.PUBLISH_MAX_REQ_SIZE) || Number(process.env.MAX_REQ_SIZE) || 256 * 1024,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • the batchWithSize util has event specific logic, like claim checks
  • this sqs sink is used for non-event type messaging in egress gateways
  • it would be nice to iterate on the util to make it more generic
  • but maybe in this case a custom sqs sink is warranted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants