Repository navigation
2.0: Enforce MessageRetentionPeriod and per-queue MaximumMessageSize - #1277
Merged
Merged
Conversation
- Store, return and enforce MessageRetentionPeriod and MaximumMessageSize (previously accepted and ignored). Defaults follow sqs-limits: strict uses the SQS defaults (4 days, 1 MiB), relaxed keeps the 1.x behaviour (no expiry, no size limit). An explicit value is always enforced; strict validates it against the SQS ranges. - Expired messages are skipped on receive and in statistics, and removed by a 1 s timer, emitting MessageRemoved events so persistence deletes them. A lower bound on message creation time keeps the check cheap. - Message size counts the body and attributes in UTF-8 bytes, as SQS does. Oversized messages fail with InvalidParameterValue; oversized batches with BatchRequestTooLong. - New queue config keys message-retention-period and maximum-message-size, written to queues-storage and the SQL queue data; 1.x data still loads. - Limits: new members for retention and maximum size, maxMessageLength renamed to maxMessageSize. - Update README, backlog and the 2.0 release notes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e image reflection metadata Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the "SQS behaviour" items from
docs/BACKLOG.md.What changes
MessageRetentionPeriodandMaximumMessageSizeused to be accepted and ignored. They are now stored, returned byGetQueueAttributesand enforced. When a queue doesn't set them, the default depends onsqs-limits:sqs-limitsstrict(default)relaxedReceiveMessageand left out of the queue statistics.MessageRemovedevents, somessages-storagedeletes them too. A lower bound on the oldest creation time means it only scans the queue when a message could have expired.InvalidParameterValue("Message must be shorter than N bytes").BatchRequestTooLong.message-retention-periodandmaximum-message-sizefor queue definitions andauto-create-queues.template.queues-storageand to the SQL queue data only when set. Data written by 1.x still loads (covered by tests).LimitsAPI:maximumMessageSizeLimit,defaultMessageRetentionPeriodandmessageRetentionPeriodLimit.maxMessageLengthis renamed tomaxMessageSize.verifyMessageLengthis replaced byverifyMessageSize.Upgrade note: with the default
strictlimits, persisted messages older than 4 days are deleted on the first start of 2.0. The release notes explain this and how to opt out.Docs: the README has a new "SQS limits" section and the new keys in its examples. The 2.0 release notes and the backlog are updated.
Testing
sbt testFullon Scala 3: all suites pass, including the SDK v1 and v2 integration suites.MessageRetentionTest: strict and relaxed defaults, per-queue retention, statistics, lowering retention, listener events.LimitsTest: size, retention and maximum-size checks.DBQueueTest: 1.x blob compatibility and round trip.scalafmtCheckAllpasses.🤖 Generated with Claude Code