Skip to content

Commit 5dc8291

Browse files
authored
Adjust limits (#403)
1 parent 780bfda commit 5dc8291

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
restart: on-failure
1111

1212
localstack:
13-
image: localstack/localstack:4.10.0
13+
image: localstack/localstack:4.13.1
1414
network_mode: bridge
1515
hostname: localstack
1616
ports:

examples/sns-sqs/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
services:
22

33
localstack:
4-
image: localstack/localstack:4.0.2
4+
image: localstack/localstack:4.13.1
55
network_mode: bridge
66
hostname: localstack
77
ports:

packages/sqs/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Publishers send messages to SQS queues. They handle:
7171
- Message validation against Zod schemas
7272
- Automatic serialization
7373
- Optional deduplication (preventing duplicate sends)
74-
- Optional payload offloading (for messages > 256KB)
74+
- Optional payload offloading (for messages > 1 MiB)
7575
- FIFO-specific concerns (MessageGroupId, MessageDeduplicationId)
7676

7777
### Consumers
@@ -380,7 +380,7 @@ When using `creationConfig`, the queue will be created automatically if it doesn
380380

381381
// Other attributes
382382
DelaySeconds: '0', // Default delay for all messages
383-
MaximumMessageSize: '262144', // 256 KB (default maximum)
383+
MaximumMessageSize: '1048576', // 1 MiB (default maximum)
384384
},
385385
tags: {
386386
Environment: 'production',
@@ -457,7 +457,7 @@ When using `locatorConfig`, you connect to an existing queue without creating it
457457
// Optional - Payload Offloading
458458
payloadStoreConfig: {
459459
payloadStore: s3Store, // S3-based payload store
460-
maxPayloadSize: 256 * 1024, // 256 KB
460+
maxPayloadSize: 1024 * 1024, // 1 MiB
461461
},
462462

463463
// Optional - Deletion
@@ -755,7 +755,7 @@ Prevents processing the same message multiple times:
755755

756756
### Payload Offloading
757757

758-
For messages larger than 256 KB, store the payload externally (e.g., S3):
758+
For messages larger than 1 MiB, store the payload externally (e.g., S3):
759759

760760
```typescript
761761
import { S3PayloadStore } from '@message-queue-toolkit/s3-payload-store'
@@ -769,15 +769,15 @@ const payloadStore = new S3PayloadStore({
769769
{
770770
payloadStoreConfig: {
771771
payloadStore,
772-
maxPayloadSize: 256 * 1024, // 256 KB threshold
772+
maxPayloadSize: 1024 * 1024, // 1 MiB threshold
773773
},
774774
}
775775

776776
// Large message is automatically offloaded
777777
await publisher.publish({
778778
id: '123',
779779
messageType: 'document.processed',
780-
largeData: hugeArrayOfData, // If total size > 256 KB, stored in S3
780+
largeData: hugeArrayOfData, // If total size > 1 MiB, stored in S3
781781
})
782782
```
783783

packages/sqs/lib/sqs/AbstractSqsService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import type { SQSMessage } from '../types/MessageTypes.ts'
99
import { deleteSqs, initSqs } from '../utils/sqsInitter.ts'
1010

1111
// https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html
12-
export const SQS_MESSAGE_MAX_SIZE = 256 * 1024 // 256KB
12+
export const SQS_MESSAGE_MAX_SIZE = 1024 * 1024 // 1 MiB
1313
export const SQS_RESOURCE_ANY = Symbol('any')
1414
export const SQS_RESOURCE_CURRENT_QUEUE = Symbol('current_queue')
1515

packages/sqs/lib/utils/sqsUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ export async function deleteQueue(
274274
/**
275275
* Calculates the size of an outgoing SQS message.
276276
*
277-
* SQS imposes a 256 KB limit on the total size of a message, which includes both the message body and any metadata (attributes).
277+
* SQS imposes a 1 MiB limit on the total size of a message, which includes both the message body and any metadata (attributes).
278278
* This function currently computes the size based solely on the message body, as no attributes are included at this time.
279279
* For future updates, if message attributes are added, their sizes should also be considered.
280280
*

0 commit comments

Comments
 (0)