Scenario: help-desk case CASE-4210 at the fictional Belgavi's Book Store, processed by an agent step behind a queue. Synthetic inputs; every calculation stays in this page and nothing is sent anywhere.
Experiment workspace
Decision trace
What this lab models
One help-desk message, CASE-4210 at the fictional Belgavi's Book Store, on an at-least-once queue with a visibility timeout, receipt handles and a redrive policy. Consumers are always polling, so the message is received again the moment it becomes visible. Each receive runs the same agent step, which takes the step time you set, sends a reply to the customer and then deletes the message with its own receipt handle. A delete with a handle that is no longer the latest is treated as not removing the message, the cautious reading of the queue documentation. All arithmetic runs in this page.
How to experiment
Start with the defaults: a 30 s visibility timeout, a 45 s step, no heartbeat and maxReceiveCount 5. The message is received five times, the customer gets five replies and the message ends in the dead-letter queue. Set a heartbeat of 10 s and the first consumer keeps ownership. Set the heartbeat to 30 s and nothing improves, because the first extension is due exactly when the timeout expires. Raise the visibility timeout to 60 s with no heartbeat for a single receive. Turn on the idempotency key with no heartbeat to see one reply but the same five receives and dead letter. Lower maxReceiveCount to 2 to see how quickly a slow step is quarantined.
Expected outcomes to check
Defaults: receives at t=0, 30, 60, 90 and 120 s, dead letter at t=150 s, 5 replies, 225 model-seconds. Heartbeat 10 s or 20 s: 1 receive, 1 reply, deleted at t=45 s. Heartbeat 30 s: same as the defaults. Visibility 60 s: 1 receive. Idempotency key on: 5 receives, 1 reply, 4 suppressed, still a dead letter. Step 29 s: deleted after one receive. maxReceiveCount 2: dead letter at t=60 s with 2 replies.
Trace, reset and export
The decision trace lists the setup, every receive, every heartbeat that arrives too late, every effect and delete, and the outcome, in time order. Start trace hides every step, Next step reveals one, Show all restores the full list and the slider selects how many are visible; none of these change the result. Reset inputs restores the defaults. Export JSON saves the inputs, each receive and effect, the counts and the full trace.
Limits
Whole seconds, one message and one step duration for every attempt. Real steps vary, real consumers poll with delays, heartbeat calls can fail or arrive late, and queues can deliver a message twice even within the timeout. The model does not include the 12-hour visibility ceiling, FIFO message groups or consumer crashes. Use it to reason about the interaction of the timeout, the heartbeat and the redrive policy, then measure your own step latency and receive counts.
Original lab by Sandeep Belgavi. Views are my own and do not represent any employer, past or present.