All notable changes to ankusa_kafka 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

  • Ankusa.Sink.Kafka implements max_message_bytes/1 from :max_record_bytes (DEL-5): an inline record whose base64 value would pass it is produced as a claim instead of being refused, and a body that is over it by itself is {:permanent, {:message_too_large, size, max}} without a broker call. Requires an ankusa release with the max_message_bytes sink callback; publish core first.

  • Ankusa.Intake.Kafka: the intake log of wal.type: dual (DUR-1.b.b, ADR 0002). Every acked hook is also a record in a replicated Kafka topic before the 201. A brod client of its own (:"ankusa_kafka.<instance>.intake", never the sink's) produces with required_acks: -1, partition_onwire_limit: 1, max_retries: 0 and an explicit partition, the node's stamped one (phash2(node_id) rem partition_count, never recomputed, so growing the topic never remaps a node). verify/1 reads DescribeConfigs and metadata at boot and refuses a topic with a replication factor under 3, min.insync.replicas under 2, unclean.leader.election.enable, a retention.ms under twice backup.max_age_ms, or a max.message.bytes under intake.max_record_bytes. Broker error codes map to the four error classes. Replay filters by node id and skips unknown kinds and versions. Needs ankusa with Ankusa.Intake. A three-broker KRaft cluster joins the package's docker-compose.yml (the Redpanda service stays for the sink's tests); bench/partition_bench.exs measures what one partition carries.

  • Sink.Kafka: with ordered: true (core, ADR 0004) the record key is the lane's key and the record carries an ankusa_ordering_key header.

Changed

0.6.0 - 2026-10-14

Added

  • :max_record_bytes (default 1_000_000): a record whose value plus key is larger is refused before it is produced, as {:error, {:permanent, _}}.
  • :idle_timeout_ms (default 600_000, 0 never, at least :produce_timeout_ms plus 1 s): a brod client with no delivery for that long is stopped (Ankusa.Sink.Reaper, requires core's) and the next delivery starts a new one.
  • Every record carries the ankusa_idempotency_key header: the same tenant-scoped key as the message's idempotency_key (Ankusa.Envelope.idempotency_key/1), always present. Requires ankusa 0.5 or newer: the key comes from Ankusa.Envelope.idempotency_key/1, which 0.4.x does not have, so the Hex requirement is now ~> 0.5.
  • ankusa_dedupe_key and ankusa_replay_id record headers when present.

Changed

  • A broker message_too_large, invalid_message or invalid_record is {:error, {:permanent, reason}}: dead-lettered at once instead of retried for the whole retry policy. Requires ankusa ~> 0.6 (sink error classes); publish core first.

Fixed

  • A :sasl password is held in a closure (brod_utils:init_sasl_opt/1, as brod_sup does before it starts a client), so neither brod's client state nor its crash report, for example when no broker answers, prints it.

0.4.0 - 2026-10-02

Added

Changed

  • The Hex requirement on ankusa is ~> 0.4 (was ~> 0.2): describe/2 needs Ankusa.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 record key still decides the partition, so Kafka's own per-partition ordering is unchanged. Requires the matching ankusa core.

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 sha256 field 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 claim field is urn: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 message v stays 1. Both come from Ankusa.Sink.Message in ankusa 0.2.1.

0.2.0 - 2026-09-27

Added

  • Ankusa.Sink.ordering_key/2, implemented by this sink as the record key, which is exactly the partition (and so the ordering) scope. Dispatch now serializes deliveries sharing a key and runs different keys concurrently. "Per-key ordering" is stated to the pipeline instead of assumed.

Changed

0.1.0 - 2026-09-23

Added

  • Initial release: Ankusa.Sink.Kafka adapter
  • Message format v1 (shared with ankusa_rabbitmq)
  • Claim Check integration for payloads > inline_max_bytes
  • Per-key ordering via configurable record key
  • Synchronous produce with acks=all
  • Kafka headers: ankusa_id, ankusa_source_id, ankusa_tenant_id, ankusa_message_version, content_type