What the SQS and SNS size limits are now, when a bigger message is the wrong fix, and how to store the payload in S3 and send a pointer, by hand, with the Extended Client Library, and with Encore.

Amazon SQS used to cap messages at 256 KiB, and a generation of AWS code exists to work around it. In August 2025 the limit went to 1 MiB for standard and FIFO queues, and SNS followed in 2026 with an opt-in topic setting. For a lot of payloads, such as a webhook body or an order with a few hundred line items, the workaround is no longer needed.
Some payloads will never fit: a PDF, a batch of telemetry, an LLM transcript. Even payloads that fit can be the wrong thing to put on a queue, because every 64 KB chunk is billed as a request and every retry moves the full body again. The answer for those is the claim check pattern: store the payload in S3 and send a pointer.
The SQS message quotas page and the SNS large payloads page hold the current numbers.
Raise the limit, or rely on the new SQS default, when payloads are reliably under 1 MiB and consumers need the full body anyway. One message, one read, no extra moving parts.
Send a pointer when payloads can exceed 1 MiB, when most consumers only need a few fields, when several subscribers would each receive a copy of a large body, or when the payload is binary. A pointer also gives you a durable copy of the payload after the message is deleted, which helps with replays and audits.
The producer writes the object first, then sends a message with the location and a checksum. Writing first means a consumer never receives a pointer to an object that does not exist yet.
type PayloadRef struct {
Bucket string `json:"bucket"`
Key string `json:"key"`
SHA256 string `json:"sha256"`
Size int64 `json:"size"`
}
func SendLarge(ctx context.Context, s3c *s3.Client, sqsc *sqs.Client, bucket, queueURL string, body []byte) error {
sum := sha256.Sum256(body)
key := "payloads/" + hex.EncodeToString(sum[:]) // content-addressed: retries reuse the object
if _, err := s3c.PutObject(ctx, &s3.PutObjectInput{
Bucket: aws.String(bucket),
Key: aws.String(key),
Body: bytes.NewReader(body),
}); err != nil {
return err
}
ref, err := json.Marshal(PayloadRef{Bucket: bucket, Key: key, SHA256: hex.EncodeToString(sum[:]), Size: int64(len(body))})
if err != nil {
return err
}
_, err = sqsc.SendMessage(ctx, &sqs.SendMessageInput{
QueueUrl: aws.String(queueURL),
MessageBody: aws.String(string(ref)),
})
return err
}
The consumer downloads the object, verifies the checksum, processes it, and deletes the message. Do not delete the object in the consumer: with several subscribers or a retry after a crash, another reader may still need it. Expire objects with an S3 lifecycle rule set longer than the queue's retention period, such as 15 days when the queue keeps messages for 14.
Give the producer s3:PutObject on the prefix and the consumer s3:GetObject, and keep both off s3:DeleteObject. If the bucket uses SSE-KMS, both roles also need the KMS key permissions.
For Java and Python, the Amazon SQS Extended Client Library wraps the SQS client and moves bodies above a threshold to S3 automatically, up to 2 GB. Producers and consumers both need the library, since a plain SQS client receives a JSON pointer it does not understand. AWS publishes it for Java and Python only, which is why Go and Node.js teams usually write the 30 lines above instead.
Best fit: payloads over 1 MiB, binary data, or fan-out of large bodies to several subscribers.
Encore brings infrastructure from code, so the claim check is a bucket and a topic declared in Go. On AWS they become an S3 bucket and SNS and SQS resources in your account; locally encore run keeps the bucket on disk and the topic in memory, so the whole flow runs on your laptop and shows up in the local development dashboard. Encore provisions an IAM role for the service.
package transcripts
import (
"bytes"
"context"
"crypto/sha256"
"encoding/hex"
"fmt"
"io"
"encore.dev/pubsub"
"encore.dev/storage/objects"
)
var Payloads = objects.NewBucket("transcript-payloads", objects.BucketConfig{})
type TranscriptReady struct {
Key string `json:"key"`
SHA256 string `json:"sha256"`
}
var TranscriptsReady = pubsub.NewTopic[*TranscriptReady]("transcripts-ready", pubsub.TopicConfig{
DeliveryGuarantee: pubsub.AtLeastOnce,
})
func Publish(ctx context.Context, body []byte) error {
sum := sha256.Sum256(body)
key := "payloads/" + hex.EncodeToString(sum[:])
w := Payloads.Upload(ctx, key)
if _, err := io.Copy(w, bytes.NewReader(body)); err != nil {
w.Abort(err)
return err
}
if err := w.Close(); err != nil {
return err
}
_, err := TranscriptsReady.Publish(ctx, &TranscriptReady{Key: key, SHA256: hex.EncodeToString(sum[:])})
return err
}
var _ = pubsub.NewSubscription(TranscriptsReady, "summarize", pubsub.SubscriptionConfig[*TranscriptReady]{
Handler: Summarize,
})
func Summarize(ctx context.Context, e *TranscriptReady) error {
r := Payloads.Download(ctx, e.Key)
defer r.Close()
body, err := io.ReadAll(r)
if err != nil {
return err
}
if sum := sha256.Sum256(body); hex.EncodeToString(sum[:]) != e.SHA256 {
return fmt.Errorf("checksum mismatch for %s", e.Key)
}
// Summarize the transcript. Safe to run twice for the same key.
return nil
}
The event stays a few hundred bytes regardless of the payload, so the SNS topic's default size limit never comes into play. Add a lifecycle rule on the bucket in the AWS console to expire old payloads, longer than the subscription's message retention, which defaults to seven days.
An agent asked to "pass the full transcript to the summarizer" can add the bucket, the event and the handler in one change and run it end to end locally, with the pointer pattern in place from the first commit rather than after the first oversized message fails in production.
Best fit: Go services passing documents, transcripts or batches between services, with storage and messaging declared next to the code that uses them.
If payloads are under 1 MiB and every consumer needs the whole body, send them on SQS directly, and raise MaximumMessageSize on SNS topics that carry them. Use a claim check for anything larger, binary or fanned out. In Java or Python the Extended Client Library does it for you; in Go and Node.js write the pointer yourself, or declare a bucket and topic with Encore and publish the key.
SQS standard and FIFO queues have accepted message payloads up to 1 MiB (1,048,576 bytes) since August 2025, up from 256 KiB. Message attributes count toward the limit. For larger payloads, store the data in S3 and send a reference to it in the message.
Use the claim check pattern: upload the payload to S3, send a small SQS message containing the bucket, key and a checksum, and have the consumer download the object. The Amazon SQS Extended Client Library does this automatically for Java and Python, with payloads up to 2 GB.
SNS topics accept 256 KiB by default, and as of September 2026 you can raise a topic's MaximumMessageSize attribute up to 1 MiB, but topics above 256 KiB only support SQS, Lambda and Data Firehose subscriptions, with at most 100 subscriptions.
Declare an Encore object storage bucket and a Pub/Sub topic. The publisher uploads the payload to the bucket and publishes an event with the object key, and the subscriber downloads it with the key. Locally the bucket is on disk and the topic is in memory; on AWS they are S3, SNS and SQS in your account.
Deploy to your cloud on AWS and Google Cloud
without managing infrastructure
Encore lets developers and agents define application infrastructure directly in code, then automatically provisions it from local development to production in your AWS or GCP account.