AsyncAPI description of CockroachDB CHANGEFEED INTO sinks. CockroachDB Enterprise CHANGEFEEDs stream row-level change data to external systems. This document models the publicly documented sink targets that behave as event/message channels: Kafka, Google Cloud Pub/Sub, and Webhook. (The cloud-storage sink writes files rather than emitting messages on a broker/channel and is intentionally out of scope here.) Source documentation: * https://www.cockroachlabs.com/docs/stable/create-changefeed * https://www.cockroachlabs.com/docs/stable/changefeed-messages * https://www.cockroachlabs.com/docs/stable/changefeed-sinks * https://www.cockroachlabs.com/docs/stable/changefeed-message-envelopes Only documented envelope shapes (wrapped, bare, key_only, row, enriched) and the documented webhook batch payload are modeled. No undocumented fields are introduced.
View SpecView on GitHubCluster ManagementCloudDatabaseDistributed SQLInfrastructurePostgreSQL CompatibleSQLAsyncAPIWebhooksEvents
Channels
table/{tableName}
publishtableRowChanged
A row in the table was inserted, updated, or deleted.
Per-table changefeed topic. On Kafka and Pub/Sub a topic is created per source table by default (the table name). Each message represents a committed row mutation in CockroachDB.
resolved
publishresolvedTimestamp
Changefeed progress checkpoint.
Resolved-timestamp progress messages. Emitted as a separate message whose envelope contains a "resolved" key whose value is an HLC timestamp string. Guarantees that no previously unseen rows with an earlier update timestamp will be emitted to the sink.
webhook/batch
publishwebhookBatchDelivered
Batched changefeed events delivered to a webhook endpoint.
Webhook sink batch delivery. CockroachDB POSTs a JSON object containing an array of individual events (each in wrapped envelope form, including after, key, topic and updated) and a length field with the batch size.
Messages
✉
EnvelopeWrapped
Wrapped envelope (default)
Default envelope; contains "after" row state and optional "before", "key", "updated".
✉
EnvelopeBare
Bare envelope
Row columns at top level; CockroachDB metadata under "__crdb__".
✉
EnvelopeKeyOnly
Key-only envelope
Primary key array only; no row payload.
✉
EnvelopeRow
Row envelope
Row columns only; no metadata, no key, no envelope wrapper.
✉
EnvelopeEnriched
Enriched envelope (Preview)
Adds op code, ts_ns, and (with enriched_properties) source/schema metadata. Operation codes: "c" (insert), "u" (update), "d" (delete).
✉
Resolved
Resolved timestamp message
Progress checkpoint emitted independently of row changes.
✉
WebhookBatch
Webhook sink batch payload
Documented webhook sink POST body. Contains a payload array of per-row events and a length field with the batch size.
Servers
kafka
kafkakafka://{broker}:{port}
Kafka changefeed sink. CockroachDB writes one Kafka topic per table by default (the table name), or a single topic when topic_name is supplied. The message key is the table's primary key. Configurable via kafka_sink_config, SASL/TLS parameters, and topic_prefix or full_table_name URI options.
googlepubsub
pubsubgcpubsub://{project}
Google Cloud Pub/Sub changefeed sink. One Pub/Sub topic per table by default. With changefeed.new_pubsub_sink_enabled (default in v23.2+), top-level message fields are capitalized: Key, Value, Topic. topic_prefix is not supported on the Pub/Sub sink.
https
webhookhttps://{endpoint}
Webhook changefeed sink. CockroachDB POSTs batches of changefeed events as a single JSON object containing a payload array and a length field to the configured HTTPS endpoint. Optional bearer/basic auth supplied via webhook_auth_header. Format must be json or avro.