Menu

1 / 2

Amazon SQS Request/Reply Between Microservices: Setup, Reply Queues, and Idempotency

DEV Community: microservices·Justin·about 3 hours ago
#KYka9wmc
#devtomicroservices#devto#dev#queue#message
Long article (3430 words) — no AI summary yet.
Reading 0:00
15s threshold

TL;DR

Amazon SQS has no built-in request/reply, so a service that needs an answer from another service has to add a correlation identifier and a reply queue of its own, and has to handle duplicate delivery because standard queues deliver each message at least once.

Three SQS settings decide whether synchronous-style calls behave well: the visibility timeout (30 seconds by default, 12 hours at most), the dead-letter queue redrive policy, and the receive wait time (long polling allows up to 20 seconds).

Message bodies are capped at 1 MiB, FIFO queues deduplicate only inside a 5-minute window, and every consumer should be idempotent regardless of queue type.

The Graftcode Amazon SQS plugin carries a Graft call over SQS in two modes: request/reply (a per-client reply queue plus a correlation ID attribute) and one-way (no reply; the message is deleted after processing).

The plugin ships as a single shared library, works with standard and FIFO queues, and can be tried locally against LocalStack with a…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.