Helpers for enriching envelopes with standardized DLQ metadata.
The canonical location for DLQ state is:
[:metadata :dlq]This metadata is designed to be portable across sinks (logger/storage/producer) and across replay mechanisms.
Helpers for enriching envelopes with standardized DLQ metadata. The canonical location for DLQ state is: - `[:metadata :dlq]` This metadata is designed to be portable across sinks (logger/storage/producer) and across replay mechanisms.
(enrich-for-deadletter envelope
{:keys [topic subscription-id runtime source deadletter
raw-payload status producer]})Adds/updates DLQ metadata on envelope.
Inputs:
ctx may include:
:topic (keyword):subscription-id (keyword):runtime (keyword, e.g. :redis/:kafka/:jetstream/:in-memory):source (map, runtime-specific details like stream/offset/etc):producer (keyword, producer/client key to route DLQ publishes):deadletter (effective per-topic dl config; stored as a snapshot):raw-payload (string/bytes; stored as portable meta):status (default :eligible)Returns updated envelope map.
Adds/updates DLQ metadata on `envelope`. Inputs: - `ctx` may include: - `:topic` (keyword) - `:subscription-id` (keyword) - `:runtime` (keyword, e.g. :redis/:kafka/:jetstream/:in-memory) - `:source` (map, runtime-specific details like stream/offset/etc) - `:producer` (keyword, producer/client key to route DLQ publishes) - `:deadletter` (effective per-topic dl config; stored as a snapshot) - `:raw-payload` (string/bytes; stored as portable meta) - `:status` (default :eligible) Returns updated envelope map.
(ensure-envelope x)Coerces x into an envelope-ish map if it isn't already one.
Coerces `x` into an envelope-ish map if it isn't already one.
(payload-hash envelope raw-payload)Computes a stable payload hash for DLQ identification/deduplication.
Preference order:
Computes a stable payload hash for DLQ identification/deduplication. Preference order: - raw payload (if available) - envelope :msg (fallback; stable and transport-agnostic)
(raw-payload-meta payload)Returns a portable representation for a raw payload.
Returns a portable representation for a raw payload.
- bytes -> {:format :bytes-base64 :data <string>}
- string -> {:format :string :data <string>}
- nil -> nilcljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |