Warren
Act on dead letters

Dry run for bulk actions

CommunityTeamPro

"Replay the first 500" or "discard every message containing ACME" is decided when Warren reads the queue. Between opening the dialog and clicking the button, new dead letters can arrive and someone else can take some away. Without a check, you would confirm 143 messages and act on 160.

So for a bulk action Warren asks the queue first and freezes the answer.

The dry run of a replay: exactly these 143 messages matching "OrderNotFound" of 200 in the queue
The dry run of a replay: exactly these 143 messages matching "OrderNotFound" of 200 in the queue

How it works

  1. Choose First N or Matching in the replay, discard or park dialog and click Check which messages.
  2. Warren reads the queue like an export, without taking anything, and remembers exactly which messages the selection takes, by fingerprint.
  3. The dialog says how many: "Exactly these 143 messages of 200 in the queue". The button changes to Replay these 143 messages.
  4. On confirm, Warren takes those messages and no others. One that arrived in the meantime stays in the queue; one that is gone by then is skipped and counted as such.

Changing the selection throws the check away. Messages you ticked in the table need no dry run: that selection is fixed already.

The dry run of a discard: 20 messages frozen, a reason for the audit log
The dry run of a discard: 20 messages frozen, a reason for the audit log

Purging

A purge empties the whole queue in one broker operation, so there is nothing to freeze. Count the queue remembers how many messages it holds; if more have arrived by the time you confirm, the purge stops and asks you to check again.

Counting the queue before a purge
Counting the queue before a purge

Rules of the token

  • It works once: a double click or a retried request does nothing the second time.
  • It is bound to you, the action and the queue: a dry run for a replay cannot confirm a discard, and nobody else can use yours.
  • It is valid for 10 minutes (WARREN_DRY_RUN_EXPIRES_AFTER).
  • With four-eyes approval (Pro) the approver confirms the frozen messages, not a new reading of the queue.

From scripts

The API has the same two steps. A bulk selection sent straight to an action answers 428 DRY_RUN_REQUIRED.

curl -b cookies -X POST http://warren:8080/api/clusters/prod/queues/orders.dlq/plans \
  -H 'content-type: application/json' \
  -d '{"kind":"REPLAY","selection":{"type":"MATCHING","match":{"text":"ACME"}}}'
# {"id":"8f0c…","count":143,"depth":160,"expiresAt":"…"}

curl -b cookies -X POST http://warren:8080/api/clusters/prod/queues/orders.dlq/replay \
  -H 'content-type: application/json' \
  -d '{"selection":{"type":"PLAN","plan":"8f0c…"},"target":{"type":"ORIGINAL"}}'

kind is REPLAY, DISCARD, PARK or PURGE. A script that cannot do two steps yet can turn the requirement off with WARREN_REQUIRE_DRY_RUN=false.