1. Home
  2. Destinations
  3. Apache Kafka
DESTINATION · QUEUES & STREAMS

Postgres to Kafka, with nothing to run.

Hosted change data capture into any broker that speaks the Kafka protocol — Amazon MSK, Redpanda, Confluent Cloud, Aiven, WarpStream, Upstash — with the row's primary key as the record key.

The Kafka sink replaces a self-managed connector cluster with a connection string. Waltail reads the write-ahead log, and produces one record per change to your topic with the ordering key as the record key, so every change to a row lands on the same partition in commit order.

Waltail does not run a Kafka cluster for you — you bring the broker. That is the point: your data goes straight to the system your consumers already read from.

How delivery works

AspectBehaviour for Apache Kafka
RecordValue = the change JSON; key = the ordering key (schema.table:pk); header idempotency_key.
BatchingOne produce per batch (default 100 records), acknowledged by the broker before the batch is marked delivered.
OrderingSame key → same partition, in commit order. Use the key for log compaction if you keep a current-state topic.
IdempotencyDedupe on the idempotency_key header or the field inside the value.
On failureA failed request is retried up to 5 times with exponential backoff (30 s, 1, 2, 4 min, with jitter). After the fifth failure the message is parked as undelivered, the console shows it with the last error, and one click replays it — later changes to the same row wait behind it so order is preserved.
Connection checkA metadata round-trip to the brokers with the configured TLS and SASL settings.

Set up in three steps

  1. Connect your database

    Paste a connection string and press Test. Waltail checks the version (12+), that wal_level is logical, that the user may replicate, and that a slot is free — and shows the fix for anything that fails. Then it creates its own publication and replication slot. Connection guide →

  2. Add Apache Kafka as a destination

    Pick the tables to stream, choose Apache Kafka, and fill in Bootstrap brokers, Topic. Press Test — Waltail checks it can reach and write to Apache Kafka before anything is saved.

  3. Change a row

    Insert or update a row. The console shows the first event as it is captured and delivered; from then on, every committed change follows within about a second. Have rows that already exist? Run a backfill — confirm the estimate and they arrive through Apache Kafka as read events.

Configuration

Fields as the console asks for them. Secrets are encrypted at rest and never shown again.

FieldConsole labelRequiredNotes
brokersBootstrap brokersYesComma-separated host:port list.
topicTopicYesAuto-created when the broker allows it.
tlsTLSOptionalHosted brokers require it.
ca_certCA certificateOptionalPEM for private CAs; implies TLS.
sasl_mechanismSASL mechanismOptionalplain, scram-sha-256 or scram-sha-512.
sasl_usernameSASL usernameOptional
sasl_passwordSASL passwordOptional

Every sink also has two tuning settings: batch size (messages per request, default 100) and rate limit (messages per second, default unlimited). Changes to one row are never in flight twice at once.

Example

Every change is this JSON envelope — data is the row after the change, old the row before it when replica identity provides it, null otherwise:

{
  "op": "update",
  "table": "public.orders",
  "data": { "id": 42, "status": "shipped", "total": 19.99 },
  "old":  { "id": 42, "status": "paid",    "total": 19.99 },
  "seq": 137,
  "idempotency_key": "9f1c3d2e-6b4a-4c7e-9d0f-2a1b3c4d5e6f",
  "commit_lsn": "0/1A2B3C8"
}

Message format reference →

Questions

Do I need a connector framework?

No. Waltail connects to your Postgres over logical replication and produces directly to the broker. There is no connector cluster or JVM in the path.

Which brokers work?

Anything that speaks the Kafka protocol: Apache Kafka, Amazon MSK, Redpanda, Confluent Cloud, Aiven, WarpStream, Upstash. Azure Event Hubs has its own sink that fills in the protocol details for you.

What is the message format?

A plain envelope — op, table, data, old, sequence, idempotency key and commit LSN. Consumers written against another tool's envelope need a small mapping; see the message format reference.

Can one topic carry many tables?

Yes. The table field names the source table, and the key is prefixed with it, so consumers can route per table.

Related

Azure Event Hubs

Kafka endpoint, connection string

Redis Streams

XADD, consumer groups

Amazon Kinesis

Data Streams, partitioned by row

Use cases: Webhooks for your database · Cache invalidation · Search index sync · Event-driven services · Audit log and archive.

Start streaming to Apache Kafka.