Skip to content

Adjust SQS limits#403

Merged
kibertoad merged 1 commit intomainfrom
fix/message-limits
Feb 20, 2026
Merged

Adjust SQS limits#403
kibertoad merged 1 commit intomainfrom
fix/message-limits

Conversation

@kibertoad
Copy link
Copy Markdown
Owner

@kibertoad kibertoad commented Feb 20, 2026

See https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html, new limit is 1 MB

Summary by CodeRabbit

  • Chores

    • Upgraded LocalStack image version to 4.13.1 across Docker Compose configurations.
  • Documentation

    • Updated SQS message size limits and threshold documentation from 256 KB to 1 MiB, enabling support for larger message payloads before offloading to external storage.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 20, 2026

📝 Walkthrough

Walkthrough

LocalStack image versions updated across docker-compose files (4.10.0→4.13.1 and 4.0.2→4.13.1), and SQS message size limits increased from 256 KB to 1 MiB in code constants and documentation to align with the new threshold.

Changes

Cohort / File(s) Summary
LocalStack Version Bumps
docker-compose.yml, examples/sns-sqs/docker-compose.yml
Updated LocalStack image tags: 4.10.0→4.13.1 and 4.0.2→4.13.1 respectively. All other service configurations unchanged.
SQS Message Size Limit Updates
packages/sqs/README.md, packages/sqs/lib/sqs/AbstractSqsService.ts, packages/sqs/lib/utils/sqsUtils.ts
Increased payload offloading threshold and SQS message size limits from 256 KB to 1 MiB in documentation, exported constant SQS_MESSAGE_MAX_SIZE, and code comments. No logic changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Hop, hop! The limits grow tall,
From 256 to a megabyte call,
LocalStack springs forward with glee,
More messages, more space, wild and free! 🚀

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Adjust SQS limits' clearly and concisely summarizes the main change in the changeset: updating SQS message size limits from 256 KB to 1 MB across multiple files and documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/message-limits

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kibertoad kibertoad merged commit 5dc8291 into main Feb 20, 2026
6 of 7 checks passed
@kibertoad kibertoad deleted the fix/message-limits branch February 20, 2026 12:04
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/sqs/lib/sqs/AbstractSqsService.ts`:
- Around line 11-12: You exported SQS_MESSAGE_MAX_SIZE (now 1 MiB) which is a
behavioral breaking change for consumers who derived maxPayloadSize from it—add
a clear changelog entry and migration note and either (A) publish this change as
a semver-major release or (B) re-introduce a backwards-compatible alias like a
deprecated SQS_LEGACY_MAX_SIZE = 256 * 1024 and document preferred usage; update
the package release notes (and packages/sqs/lib/index.ts re-export) to call out
the change, recommended migration steps for consumers using
payloadStoreConfig.maxPayloadSize, and which symbol (SQS_MESSAGE_MAX_SIZE vs
SQS_LEGACY_MAX_SIZE) they should use going forward.
- Around line 11-12: The SQS_MESSAGE_MAX_SIZE constant declares the SQS service
limit (1 MiB) but the pinned `@aws-sdk/client-sqs` may still enforce the older 256
KiB client-side validator; either upgrade the SDK to a version that includes the
1 MiB validator (>= 3.990.0) or explicitly document the mismatch where
SQS_MESSAGE_MAX_SIZE is defined in AbstractSqsService.ts so callers know the SDK
may reject MessageBody >256 KiB; update package.json dependency for
`@aws-sdk/client-sqs` to >=3.990.0 and/or add a comment next to
SQS_MESSAGE_MAX_SIZE clarifying it reflects the service limit not the SDK
validator limit.

In `@packages/sqs/README.md`:
- Line 383: The inline comment on MaximumMessageSize is ambiguous; update the
comment next to the MaximumMessageSize attribute to state that '1048576' is the
new maximum allowed per-message size (1 MiB) rather than a changed default, and
clarify that leaving the attribute unset preserves the previous default (262144
bytes) while explicitly setting MaximumMessageSize: '1048576' opts the queue
into the larger cap; reference the MaximumMessageSize attribute in the README to
make this distinction explicit.

Comment on lines 11 to +12
// https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html
export const SQS_MESSAGE_MAX_SIZE = 256 * 1024 // 256KB
export const SQS_MESSAGE_MAX_SIZE = 1024 * 1024 // 1 MiB
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

SQS_MESSAGE_MAX_SIZE is a publicly exported constant — this is a behavioral breaking change that needs a changelog entry.

SQS_MESSAGE_MAX_SIZE is re-exported from packages/sqs/lib/index.ts. Any consumer who derived their maxPayloadSize from this constant (e.g., payloadStoreConfig: { maxPayloadSize: SQS_MESSAGE_MAX_SIZE }) will now silently skip S3 offloading for messages between 256 KiB and 1 MiB. Infrastructure relying on those messages flowing through S3 (lifecycle policies, monitoring, auditing) could be affected. A semver-major bump or explicit migration note in the changelog is warranted.

Amazon SQS increased the maximum message payload size from 256 KiB to 1 MiB for standard and FIFO queues, so the constant value itself is correct.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/sqs/lib/sqs/AbstractSqsService.ts` around lines 11 - 12, You
exported SQS_MESSAGE_MAX_SIZE (now 1 MiB) which is a behavioral breaking change
for consumers who derived maxPayloadSize from it—add a clear changelog entry and
migration note and either (A) publish this change as a semver-major release or
(B) re-introduce a backwards-compatible alias like a deprecated
SQS_LEGACY_MAX_SIZE = 256 * 1024 and document preferred usage; update the
package release notes (and packages/sqs/lib/index.ts re-export) to call out the
change, recommended migration steps for consumers using
payloadStoreConfig.maxPayloadSize, and which symbol (SQS_MESSAGE_MAX_SIZE vs
SQS_LEGACY_MAX_SIZE) they should use going forward.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify the `@aws-sdk/client-sqs` version in use and check for large-message tests.

# 1. Show declared version across all package.json files (excluding node_modules)
echo "=== Declared `@aws-sdk/client-sqs` version ==="
fd 'package.json' --type f | xargs grep '"@aws-sdk/client-sqs"' 2>/dev/null

# 2. Check if any test or source files exercise message sizes near/above 262144 bytes
echo -e "\n=== Large-message test/usage references ==="
rg -n --type ts -C 3 'SQS_MESSAGE_MAX_SIZE|262144|1048576|maxPayloadSize'

Repository: kibertoad/message-queue-toolkit

Length of output: 6192


🏁 Script executed:

#!/bin/bash
# Check how payload offloading handles large messages and look for validator constraints

# 1. Look at payload offloading implementation
echo "=== Payload offloading implementation ==="
fd 'payloadOffloa' --type ts | head -5 | xargs -I {} bash -c 'echo "File: {}"; head -50 {}'

# 2. Search for test message creation to see if large messages are actually sent
echo -e "\n=== Test message creation in payload offloading tests ==="
rg -A 10 'describe.*payload offloading' packages/sqs/test/consumers/SqsPermissionConsumer.payloadOffloading.spec.ts | head -30

Repository: kibertoad/message-queue-toolkit

Length of output: 1332


🌐 Web query:

@aws-sdk/client-sqs 3.812.0 validator maxLength 262144 SQS 1 MiB limit when updated

💡 Result:

Amazon SQS raised the maximum message payload size to 1,048,576 bytes (1 MiB) on August 4, 2025 (from 256 KiB). [1] The SQS quotas/docs now state “Message size … maximum is 1,048,576 bytes (1 MiB)”, and the FAQ likewise says MaximumMessageSize can be set up to 1 MiB. [2][3]

So if @aws-sdk/client-sqs@3.812.0 is still enforcing a maxLength: 262144 validator, that limit reflects the old 256 KiB (262,144 bytes) model and the SDK’s generated validation metadata hasn’t caught up to the service change yet.

When will the SDK update? I couldn’t find any AWS-published date/commit guaranteeing when @aws-sdk/client-sqs will change that validator; as of today (Feb 20, 2026), the authoritative service limit is already 1 MiB in AWS docs, but the SDK-side validator may still be outdated. [2][3]

Practical implication: SQS can accept up to 1 MiB (subject to the queue’s MaximumMessageSize), but the JS v3 client may block >262,144-byte MessageBody locally until the model/validator is updated (or you bypass/patch that validation). [2][3]

Sources
[1] Amazon SQS “What’s New” announcement (Aug 4, 2025)
[2] SQS Developer Guide – message quotas (Message size max 1,048,576 bytes)
[3] SQS FAQ – configuring MaximumMessageSize up to 1 MiB


🏁 Script executed:

#!/bin/bash
# Look at the actual test to see message sizes being tested

echo "=== Test file content (first 150 lines) ==="
cat -n packages/sqs/test/consumers/SqsPermissionConsumer.payloadOffloading.spec.ts | head -150

Repository: kibertoad/message-queue-toolkit

Length of output: 6846


Upgrade @aws-sdk/client-sqs to 3.990.0 or verify the version includes the 1 MiB validator.

The project pins @aws-sdk/client-sqs@3.812.0, which may still enforce a client-side validation limit of 262,144 bytes for MessageBody (the pre-August 2025 limit). AWS announced the 1 MiB limit increase on August 4, 2025, but the SDK's Smithy-generated validators lag behind the service model update. The current tests work because they use S3 payload offloading—only sending a small pointer message to SQS—rather than testing direct 1 MiB message sends.

If any code attempts to send a MessageBody between 256 KiB and 1 MiB directly to SQS without offloading, the client-side validator will reject it before the request reaches AWS. Either upgrade the SDK to a version released after the service model was updated, or document that SQS_MESSAGE_MAX_SIZE represents the SQS service limit, not the SDK's validator limit for direct messages.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/sqs/lib/sqs/AbstractSqsService.ts` around lines 11 - 12, The
SQS_MESSAGE_MAX_SIZE constant declares the SQS service limit (1 MiB) but the
pinned `@aws-sdk/client-sqs` may still enforce the older 256 KiB client-side
validator; either upgrade the SDK to a version that includes the 1 MiB validator
(>= 3.990.0) or explicitly document the mismatch where SQS_MESSAGE_MAX_SIZE is
defined in AbstractSqsService.ts so callers know the SDK may reject MessageBody
>256 KiB; update package.json dependency for `@aws-sdk/client-sqs` to >=3.990.0
and/or add a comment next to SQS_MESSAGE_MAX_SIZE clarifying it reflects the
service limit not the SDK validator limit.

Comment thread packages/sqs/README.md
// Other attributes
DelaySeconds: '0', // Default delay for all messages
MaximumMessageSize: '262144', // 256 KB (default maximum)
MaximumMessageSize: '1048576', // 1 MiB (default maximum)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

// 1 MiB (default maximum) is ambiguous — clarify whether this is the new per-queue default or just the new maximum allowed value.

The MaximumMessageSize queue attribute previously defaulted to 262,144 bytes (256 KiB). If you've explicitly set the MaximumMessageSize attribute, you might need to adjust it to a new desired value. This wording implies the default was not automatically raised to 1 MiB — only the maximum ceiling was. If that's the case, setting MaximumMessageSize: '1048576' here doesn't represent the default but rather explicitly opts into the new maximum.

📝 Suggested comment clarification
-        MaximumMessageSize: '1048576',      // 1 MiB (default maximum)
+        MaximumMessageSize: '1048576',      // 1 MiB (new maximum; set explicitly to opt in)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
MaximumMessageSize: '1048576', // 1 MiB (default maximum)
MaximumMessageSize: '1048576', // 1 MiB (new maximum; set explicitly to opt in)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/sqs/README.md` at line 383, The inline comment on MaximumMessageSize
is ambiguous; update the comment next to the MaximumMessageSize attribute to
state that '1048576' is the new maximum allowed per-message size (1 MiB) rather
than a changed default, and clarify that leaving the attribute unset preserves
the previous default (262144 bytes) while explicitly setting MaximumMessageSize:
'1048576' opts the queue into the larger cap; reference the MaximumMessageSize
attribute in the README to make this distinction explicit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant