All notable changes to ankusa_nats will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased
0.7.0 - 2026-10-28
Added
:max_message_bytes(default 1 MiB, NATS'smax_payload; DEL-5). A message over it is never sent: an inline body whose base64 would not fit is checked in and published as a claim, and a body over the limit by itself is{:permanent, {:message_too_large, size, max}}without a server call. Requires anankusarelease with themax_message_bytessink callback; publish core first.Sink.NATS: a hook of anordered: truesink carries the lane's key as theankusa_ordering_keyheader (consumer-side ordering, ADR 0004).
Changed
- Requires
gnat ~> 1.18. The sink hands:password,:tokenand:nkey_seedto gnat as zero-arity functions, so neither theGnatconnection nor itsGnat.ConnectionSupervisorholds them in the clear in its state,:sys.get_status/1or a crash report. - A publish over the server's
max_payloadis{:error, {:permanent, :max_payload_exceeded}}and is dead-lettered at once. gnat 1.18 refuses it before sending; on 1.17 the server closed the connection, cutting off every publish in flight on it. - Requires
ankusa ~> 0.7(Ankusa.Sink.Messaging,Ankusa.Sink.Connections); publish core first. Ankusa.Sink.NATSis built on core'sAnkusa.Sink.MessagingandAnkusa.Sink.Connections. Same headers and values;ankusa_message_versionnow comes beforeankusa_idempotency_key, the orderAnkusa.Sink.Kafkasends. An entry of:serverswithout a port raisesArgumentErrorinstead ofMatchError.
0.6.0 - 2026-10-14
Added
:idle_timeout_ms(default600_000,0never, at least:publish_timeout_msplus 1 s): a connection with no delivery for that long is closed (Ankusa.Sink.Reaper, requires core's) and the next delivery opens a new one.- Every message carries the
ankusa_idempotency_keyheader: the same tenant-scoped key as the message'sidempotency_key(Ankusa.Envelope.idempotency_key/1), always present. Requiresankusa0.5 or newer: the key comes fromAnkusa.Envelope.idempotency_key/1, which 0.4.x does not have, so the Hex requirement is now~> 0.5. ankusa_dedupe_keyandankusa_replay_idheaders when present.
Changed
- Requires
ankusa ~> 0.6(Ankusa.Sink.Reaper); publish core first. - The connection is a
Gnat.ConnectionSupervisorregistered through the instance's registry: starting it returns at once and the handshake runs in that supervisor, so a slow or dead server no longer stalls theDynamicSupervisor(and every other delivery) behind it. It reconnects on its own with a 2 s backoff;deliver/3returns{:error, :not_connected}meanwhile. - The connection supervisor's child spec holds the connection settings inside
a closure, so
:sys.get_status/1ofAnkusa.Sink.NATS.Supervisor, or a supervisor report, never prints a password, token or nkey seed. - Breaking: every publish sets
Nats-Msg-Idto the hookid(id:replay:<replay_id>on a replay), so a stream's duplicate window drops a re-publish of the same delivery inside the window (0.4.0 set none).
0.4.0 - 2026-10-02
Added
Ankusa.Sink.NATSimplementsAnkusa.Sink.describe/2, advertising its servers and subject to the AsyncAPI document the admin API serves.:serversnow also takes one comma-separated string, as the YAML key documents.
Changed
- The Hex requirement on
ankusais~> 0.4(was~> 0.2):describe/2needsAnkusa.Sink.Description, which core has from 0.4.0.
Removed
- The sink no longer implements the removed Ankusa.Sink.ordering_key/2 callback:
deliveries are unordered. The subject still decides which stream order the
message joins, so NATS/JetStream's own per-subject ordering is unchanged.
Requires the matching
ankusacore.
0.3.0 - 2026-10-01
No code changes. Released as 0.3.0 in step with ankusa 0.3.0 and the other packages in this release.
0.2.1 - 2026-09-28
Added
- A
sha256field on a claim-checked message: the lowercase hex digest of the payload, for the reader to verify the bytes it redeems against. It used to live inside the claim ref.
Changed
- The message
claimfield isurn:ankusa:claim:v1:<tenant>:<claim_id>: a tenant and a canonical (uppercase) ULID, where it used to carry the pack id, byte offset/length, and digest. The messagevstays1. Both come fromAnkusa.Sink.Messageinankusa0.2.1.
0.2.0 - 2026-09-27
Added
Ankusa.Sink.NATS: publishes delivered hooks to a NATS JetStream subject on a stream the operator owns (the sink never creates one). Delivery is acknowledged by JetStream's publish ack, not by the write to the socket.- Ankusa.Sink.ordering_key/2, implemented by this sink as the subject: the scope order is defined within ("the order the stream received it"). Dispatch serializes deliveries sharing it and runs different subjects concurrently.
- Message format v1 (shared with
ankusa_rabbitmq/ankusa_kafka), claim check integration for payloads over:inline_max_bytes(default 64 KiB), and the same five NATS headers the Kafka sink sets on a record. - Supervised, self-reconnecting gnat connection per
{instance, connection};deliver/3returns{:error, :not_connected}while one is down, which the source's retry policy already handles.
Changed
- The message
claimfield is now a claim-check ref URN string instead of a nested ticket object, breaking for consumers; the messagevstays1.