Short answer: choose the queue whose redrive and replay behavior your smallest team can operate during an outage, then apply dynamic rate limiting at the consumer boundary so slow consumption does not change a reservation's expiry deadline.
A marketplace reservation should expire after its hold window, even when the worker is deliberately consuming slowly. The queue choice matters less than the recovery boundary: can a rate change pause consumption without losing the deadline, and can an operator replay the work without creating a second release?
Keep the clock authoritative.
Deadlines win.
| Queue shape | Useful recovery property | Main trade-off |
|---|---|---|
| Broker with explicit dead-letter routing | Failed expiry attempts can be routed for inspection or retry | Routing and retry policy need careful configuration |
| Managed visibility-timeout queue | A worker can return work to the queue after a bounded attempt | The deadline is coupled to lease and visibility settings |
| Log-based partitioned stream | Replay and consumer offset control are first-class | Per-reservation timing needs an additional scheduler or index |
| In-process or data-store stream | Simple local rate control and explicit consumer state | Durability and operational recovery depend on the surrounding store |
My decision rule is short: select the queue whose redrive and replay behavior the smallest team can operate during a provider outage. Then put dynamic rate limiting at the consumer boundary, where it can slow work without changing reservation state. A weekly shipping cadence leaves little room for an expiry system that only works on its happy path.
What must happen when a hold expires?
For a reservation created at 09:00:00 with a 20-minute hold, the business deadline is 09:20:00. That timestamp belongs to the reservation, not to the queue message. A delayed worker at 09:24:00 must see that the hold is stale and perform an idempotent release, or record that another actor already did it. It must not extend the hold because the queue was busy.
That distinction is the first useful design constraint. Dynamic limiting controls work admission. It does not redefine business time. A token bucket, semaphore, or sleep between receives can reduce pressure on a downstream API, but none of those mechanisms is a scheduler of record.
The second constraint is recovery. A worker can die after releasing inventory and before acknowledging the message. It can also acknowledge after a downstream timeout whose outcome is unknown. Both cases require a stable reservation identifier and an operation that is safe to repeat. “Exactly once” is not a recovery plan; an idempotency key and a visible audit state are.
I keep three timestamps in the event payload: expiresAt, attemptedAt, and completedAt. The first is the domain deadline. The other two are operational evidence. I initially thought the queue's enqueue time would be enough; later I found that it cannot explain whether a late release came from a paused worker, a slow partner, or a scheduler that missed its bucket. Keeping the fields separate makes that distinction durable in the record and keeps incident review focused on a repairable cause rather than a guess.
Which message queue helps with dynamic rate limiting?
The matrix is intentionally about failure handling, not throughput leaderboards. Throughput numbers become fiction once the worker is waiting on a partner API, a tenant quota, or an operator-set throttle.
RabbitMQ documents dead-letter exchanges as a routing mechanism for messages rejected, expired, or otherwise dead-lettered under configured conditions. That is a useful fit when the recovery workflow needs a named route for inspection and controlled redelivery. The cost is policy surface area: expiration, acknowledgement, retry delay, and dead-letter routing must be designed together.
Amazon SQS exposes visibility timeout as a lease-like period during which a received message is hidden from other consumers. This is a practical fit when the worker owns a bounded attempt and can let a failed message become visible again. The lease is not the reservation deadline, though. A visibility timeout that is longer than the business hold can make an already-expired reservation look in flight, while one that is too short can create concurrent attempts.
Kafka describes a partitioned event log with consumer offsets. That gives replay and explicit offset control, which is valuable when a team needs to reconstruct state or run a second consumer. It does not provide per-reservation expiry by itself. A separate timing index, bucketed scheduler, or expiration service still has to decide when a hold is due.
Those are different boundaries. A queue with convenient delay semantics is not automatically better for a marketplace hold. Ask where the system records the deadline, where a failed release goes, and how an operator resumes it. The answer should fit the team’s recovery routine, not the feature list.
That is the whole trick.
How should dynamic limiting meet expiry scheduling?
Use two loops with different jobs. The scheduler makes due work available. The consumer decides how much work to admit now. Coupling them produces a familiar failure: an operator reduces the rate to protect a downstream service, and the backlog quietly crosses the reservation deadline.
A minimal consumer can make the separation explicit. The rate limiter is an injected policy, and the release command is idempotent by reservation ID. The queue interface says nothing about a particular broker.
type ExpiryJob = { reservationId: string; expiresAt: string; }; type Queue<T> = { receive(): Promise<T | undefined>; acknowledge(job: T): Promise<void>; retry(job: T, reason: string): Promise<void>; }; type ReservationStore = { releaseIfHeld(reservationId: string, at: string): Promise<"released" | "already-done">; }; type RatePolicy = { waitForPermit(): Promise<void>; }; async function consumeExpiry( queue: Queue<ExpiryJob>, reservations: ReservationStore, rate: RatePolicy, now: () => string, ): Promise<void> { const job = await queue.receive(); if (!job) return; await rate.waitForPermit(); try { await reservations.releaseIfHeld(job.reservationId, now()); await queue.acknowledge(job); } catch (error) { await queue.retry(job, error instanceof Error ? error.message : "unknown failure"); } } This code is small on purpose. It does not pretend that a queue can make an external release atomic. The store needs a conditional transition such as held -> released, guarded by the reservation ID and business deadline. The retry policy needs a bounded attempt count and a terminal route with enough context for a human or repair job.
A rate change should be observable as a consumer decision. Record permits requested, permits granted, receive age, expiry lateness, retry count, and terminal failures. Alert on the age of the oldest due hold, not only on queue depth. A shallow queue can still contain an urgent reservation if the scheduler is partitioned by tenant or time bucket.
What does a safe rollout look like?
Start with a clock-based test matrix. Include a job received before its deadline, after its deadline, exactly at its deadline, and after two retries. Add a duplicate delivery after a successful release. The expected result is one state transition, one durable audit record, and no inventory returned twice.
Then test pressure separately. Hold the downstream dependency, lower the permit rate, and let the due set grow. The system should expose lateness before a customer reports an expired cart that still appears reserved. Restore the dependency and verify that replay drains in deadline order where the business requires it.
Deploy the scheduler and consumer policy independently. That lets me change admission without rewriting the event contract. It also keeps the revenue-per-hour calculation honest: the engineering work buys a recoverable workflow, not a new collection of queue-specific knobs.
I would avoid a single global rate for a multi-tenant SaaS marketplace. A noisy tenant can consume the shared budget and make another tenant’s holds late. Per-tenant limits plus a small global ceiling are easier to reason about, although they require metrics that include tenant identity. The exact numbers belong in configuration and load tests, not in the article or the message schema.
When is the runner-up the better choice?
A broker with explicit dead-letter routing is a strong operational fit when the team already has a practiced replay process and needs routing decisions to be visible. A visibility-timeout queue can be the better boundary when the workload is simple, attempts are short, and the team wants the broker to hide in-flight work during a retry window. A log-based stream wins when replay, audit history, and multiple independent consumers matter more than native per-item timing.
None of those choices removes the need for an expiry state machine. Choose the one whose failure artifacts your on-call routine can understand at 02:00. For a one-person SaaS, that is the practical definition of reliability: a stale hold has a deadline, a repeatable command, and a recovery path that does not require remembering undocumented queue behavior.
References
- RabbitMQ, “Dead Letter Exchanges”: https://www.rabbitmq.com/docs/dlx
- Amazon Web Services, “Amazon SQS visibility timeout”: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html
- Apache Kafka documentation, “Introduction”: https://kafka.apache.org/intro
- IETF, “The HTTP Semantics: Idempotent Methods”: https://www.rfc-editor.org/rfc/rfc9110.html#name-idempotent-methods


