Standard or FIFO¶
The adapter is two backends because a queue's type decides what the backend can honestly declare,
and Capabilities is
declared before anything is built, not discovered by
trying. One backend with a flag would have to declare the lesser of the two or lie about the other.
FIFO |
Standard |
|
|---|---|---|
| what it is | one FIFO topic per subject, the subject as the message group | standard topics and queues, for throughput |
| delivery modes | AtMostOnce, AtLeastOnce |
AtLeastOnce only |
| ordering | strict per subject, one message in flight per subject per queue | best effort |
| deduplication on publish | by the event's identity | none |
| routes around a wedged member | no | yes |
| a declined message's delay | up to twelve hours from the call under MaxHeadroom, otherwise from the receive |
up to twelve hours from the receive |
| topic and queue names | end .fifo |
no suffix |
Both survive a restart, both keep a lease with the visibility timeout in whole seconds, and neither matches a pattern.
Why Standard cannot offer at-most-once¶
At-most-once means the adapter deletes a message before handing it over, so a handler that crashes
has lost it and nothing can deliver it twice. A standard queue may deliver a message even after it has
been deleted. That is exactly the case the mode forbids, so Standard refuses an AtMostOnce
subscription at Subscribe with messaging.ErrNotSupported, and does not declare the mode.
What FIFO costs¶
One message in flight per subject per queue. The adapter sets the subject as the SNS message group, and SQS FIFO delivers a group one message at a time, which is what strict ordering costs. A message received and not settled holds back the rest of its subject on that queue until its visibility lapses.
Wedged members block. On Standard a slow consumer's messages can be taken by another, so the
adapter declares RoutesAroundDegraded. On FIFO a wedged member's message in flight blocks its
subject's whole group. The conformance row measured exactly that, and the capability follows it.
Deduplication. FIFO publishes carry a deduplication ID of the SHA-256 of the event's source and ID,
so SNS stores a retried publish of the same event once. Standard has no identity to deduplicate on
and stores it twice; the adapter's tests assert both. A Standard consumer has to tolerate duplicates
from both a retried publish and an at-least-once redelivery.
Choose¶
- Need
AtMostOnce, or per-subject ordering:FIFO. - Need throughput or best-effort ordering, with idempotent handlers:
Standard. - Whichever you pick, Limits has the AWS quotas on FIFO topics, on consumers per subject and on publish throughput.
The message group is the subject, so ordering is per subject and never across subjects.