Repository navigation
Description
Noticed while implementing #429.
getQueueAttributes reports MaximumMessageSize as 262144 (256 KiB) for a queue created without naming it:
"MaximumMessageSize": getAttrOrDefault(q.Attributes, "MaximumMessageSize", "262144"),The current CreateQueue API reference documents the default as 1,048,576 bytes (1 MiB):
MaximumMessageSize– The limit of how many bytes a message can contain before Amazon SQS rejects it. Valid values: An integer from 1,024 bytes (1 KiB) to 1,048,576 bytes (1 MiB). Default: 1,048,576 bytes (1 MiB).
256 KiB was the historical SQS limit; AWS raised it. So a consumer reading this attribute back to size its own batching or to assert on a queue's configured limit gets a value real SQS has not returned for some time.
Why it is not fixed in #429
#429 added sqsAttributeDefaults, which deliberately mirrors getQueueAttributes' inline fallbacks rather than the AWS reference, so the CreateQueue attribute comparison and the read path cannot disagree about what a queue's effective attributes are. A comparison using different defaults than the read path would reject re-create requests naming exactly what a caller had just read back.
That means the stale value is currently consistent in both places, and correcting it is a separate, observable change to GetQueueAttributes output — not something to smuggle into an error-fidelity fix. emulator/sqs_createqueue.go carries // TODO(#N) pointing here.
Scope
- Change the fallback in
getQueueAttributesand the matching entry insqsAttributeDefaultstogether, so they stay in lockstep. - Check whether anything enforces the limit on
SendMessage— if a size check exists it must move with the default, and if none exists, note that rather than adding one here. - Verify the value against the CreateQueue reference at implementation time rather than trusting the number above.
Acceptance criteria
-
GetQueueAttributesreports the documented default for a queue created without the attribute. -
sqsAttributeDefaultsmatches, and theTODOinsqs_createqueue.gois removed. - A test pins the value, so a future drift from the reference is caught.
- Any
SendMessagesize enforcement is consistent with the new default, or its absence is documented. -
docs/services.mdSQS section states the default if it names one.
Activity
feat(sqs): QueueNameExists on attribute conflict, seedable QueueDelet…
feat(sqs): QueueNameExists on attribute conflict, seedable QueueDelet…
fix(sqs): MaximumMessageSize default is 1 MiB, not 256 KiB (#439)
fix(sqs): MaximumMessageSize default is 1 MiB, not 256 KiB (#439) (#450)
scttfrdmn commentedon Aug 1, 2026
Fixed in #450, shipping in v0.84.0.
GetQueueAttributesnow reports1048576for a queue created without the attribute.Confirmed against the CreateQueue reference: "Valid values: An integer from 1,024 bytes (1 KiB) to 1,048,576 bytes (1 MiB). Default: 1,048,576 bytes (1 MiB)." 256 KiB is the historical limit, not the current default. An explicitly requested value is still honored — 256 KiB remains legal, it is simply no longer what a bare queue reports.
Both default sites moved together and now share one constant:
getQueueAttributes' inline fallback and thesqsAttributeDefaultsmap thatCreateQueue's conflict check (#429) resolves an existing queue's unset attributes through. That coupling is load-bearing — if they diverged,GetQueueAttributeswould report one number and a re-create naming exactly that number would be rejected asQueueNameExists. A named constant makes the divergence impossible rather than merely tested, and the idempotent-re-create test covers it either way. (Mutation-tested by reverting only the read path: it fails withQueueNameExists, exactly as predicted.)Scoping the part that did not change: substrate still does not enforce
MaximumMessageSizeonSendMessage— no length check exists against the attribute or any constant, so an oversized body is accepted. Per this issue's own acceptance criteria that absence is now documented indocs/services.mdrather than left implicit. Enforcement is a new error path with its own scope (the exact error code needs confirming, and there are open questions about whether message attributes count toward the total and how batches are measured), so it is tracked separately as #454.The
TODO(#439)insqs_createqueue.gois removed.chore(release): v0.84.0 (#451)