Prompt
unhappy with AWS SQS visibility timeout issues
Latest observation
Oct 24, 2026
OpenAI APIWeb search: off
If you’re unhappy with AWS SQS visibility timeout behavior, you’re not alone. The usual pain points are:
- messages reappearing before processing finishes
- duplicates when processing takes longer than expected
- visibility timeout being hard to tune for variable workloads
- retries/redelivery feeling unpredictable
A few practical ways to reduce the pain:
-
Set visibility timeout based on worst-case processing time
- Make it comfortably longer than the longest expected job, not the average.
- If jobs vary a lot, consider starting with a moderate timeout and extending it while processing.
-
Extend visibility dynamically
- Use
ChangeMessageVisibilitywhen a worker is still processing and needs more time. - This is often the best approach for long-running or unpredictable tasks.
- Use
-
Make consumers idempotent
- Assume duplicates will happen.
- Use a deduplication key, database uniqueness constraint, or “processed message” record.
-
Track processing state externally
- Store job status in a DB or cache so a duplicate message can safely no-op.
-
Tune retry and failure handling
- Move poison messages to a DLQ.
- Don’t rely on visibility timeout alone as your retry mechanism.
-
Consider whether SQS is the right tool
- If you need strict lease-like processing guarantees or long-running workflows, alternatives may fit better:
- Amazon MQ / RabbitMQ if you want broker-style semantics
- AWS Step Functions for workflows
- Kafka/MSK if you need streaming/event log semantics
- A job queue with explicit heartbeats/leases in your app if you need tighter control
- If you need strict lease-like processing guarantees or long-running workflows, alternatives may fit better:
If you want, I can help with one of these specifically:
- how to configure SQS visibility timeout correctly
- a pattern for extending visibility in code
- a comparison of SQS vs another queue for your use case
- troubleshooting duplicate processing in SQS