Create all topics on an empty Kafka cluster from AsyncAPI
The new cluster has nothing. One document brings the topics over, and a revert takes them away again.

The recording shows kurkik kafka sync on the demo sandbox; its data differs from this example.
Shown here: one broker. Other broker setups are further down.
The plan
Section titled “The plan”Nothing changes yet. --dry-run only shows what would happen.
$ kurkik kafka sync a.yaml b --dry-runSync a.yaml into b - Apache Kafka, cluster MkU3OEVBNTcwNTJENDM2Qkowns: the whole cluster - the document names no x-kurkik.kafka.server.topicPrefixes; access, as x-kurkik.kafka.server.acl declares itplan: <digest>Run one sync per cluster at a time: two at once each plan against a state the other is changing.
changes (3) + create customers.updated + create orders.created + create payments.settled
left alone (8) not decided receive_customers.updated groupId Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_customers.updated' declares no consumer group, so there is nothing a broker could confirm. not decided receive_orders.created groupId Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_orders.created' declares no consumer group, so there is nothing a broker could confirm. not decided receive_payments.settled groupId Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_payments.settled' declares no consumer group, so there is nothing a broker could confirm. not decided send_customers.updated action Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'customers.updated', so operation 'send_customers.updated' is not checked. not decided send_orders.created action Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'orders.created', so operation 'send_orders.created' is not checked. not decided send_payments.settled action Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'payments.settled', so operation 'send_payments.settled' is not checked. and 2 differences sync does not act on - servers, messages, undeclared settings; kurkik kafka diff shows them
applying needs: DESCRIBE and DESCRIBE_CONFIGS on the topics it reads; CREATE on TOPIC customers.updated (or on the CLUSTER); CREATE on TOPIC orders.created (or on the CLUSTER); CREATE on TOPIC payments.settled (or on the CLUSTER)
3 changes
rehearsal [+] done create customers.updated [+] done create orders.created [+] done create payments.settled
The cluster would accept every request it was shown. Nothing was changed.exit 2$ kurkik kafka sync a.yaml b --yesSync a.yaml into b - Apache Kafka, cluster MkU3OEVBNTcwNTJENDM2Qkowns: the whole cluster - the document names no x-kurkik.kafka.server.topicPrefixes; access, as x-kurkik.kafka.server.acl declares itplan: <digest>Run one sync per cluster at a time: two at once each plan against a state the other is changing.
changes (3) + create customers.updated + create orders.created + create payments.settled
left alone (8) not decided receive_customers.updated groupId Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_customers.updated' declares no consumer group, so there is nothing a broker could confirm. not decided receive_orders.created groupId Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_orders.created' declares no consumer group, so there is nothing a broker could confirm. not decided receive_payments.settled groupId Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_payments.settled' declares no consumer group, so there is nothing a broker could confirm. not decided send_customers.updated action Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'customers.updated', so operation 'send_customers.updated' is not checked. not decided send_orders.created action Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'orders.created', so operation 'send_orders.created' is not checked. not decided send_payments.settled action Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'payments.settled', so operation 'send_payments.settled' is not checked. and 2 differences sync does not act on - servers, messages, undeclared settings; kurkik kafka diff shows them
applying needs: DESCRIBE and DESCRIBE_CONFIGS on the topics it reads; CREATE on TOPIC customers.updated (or on the CLUSTER); CREATE on TOPIC orders.created (or on the CLUSTER); CREATE on TOPIC payments.settled (or on the CLUSTER)
3 changes
applied [+] done create customers.updated [+] done create orders.created [+] done create payments.settled
Applied 3 of 3 changes - 8 left alonesnapshot: ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yamlrollback: ~/.local/state/kurkik/sync/b/b-<time>.rollback.yamlundo: kurkik kafka sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yamlexit 0Rollback file
Section titled “Rollback file”Written before the first change.
rollback.yaml
system: "Apache Kafka"target: "MkU3OEVBNTcwNTJENDM2Qk"createdAt: "<time>"document: "~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml"entries:- forAction: "create-channel:customers.updated" undo: "DELETE_CREATED_CHANNEL" target: "customers.updated" note: "sync created this. Undoing it deletes the channel and whatever was written\ \ to it since."- forAction: "create-channel:orders.created" undo: "DELETE_CREATED_CHANNEL" target: "orders.created" note: "sync created this. Undoing it deletes the channel and whatever was written\ \ to it since."- forAction: "create-channel:payments.settled" undo: "DELETE_CREATED_CHANNEL" target: "payments.settled" note: "sync created this. Undoing it deletes the channel and whatever was written\ \ to it since."Revert
Section titled “Revert”$ kurkik kafka sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml b --force --yesRevert b to b-<time>.snapshot.yaml - Apache Kafka, cluster MkU3OEVBNTcwNTJENDM2Qkowns: what the run being undone changed, as its rollback records itplan: <digest>Run one sync per cluster at a time: two at once each plan against a state the other is changing.
changes (3) - delete payments.settled [destroys messages] Every message written to payments.settled since sync created it is deleted. - delete orders.created [destroys messages] Every message written to orders.created since sync created it is deleted. - delete customers.updated [destroys messages] Every message written to customers.updated since sync created it is deleted. note: Kafka deletes topics asynchronously: the name can stay taken for a while. A recreation waits up to 60s, and if the create fails after the delete, the rollback holds the topic's definition. note: A cluster with delete.topic.enable=false refuses every deletion; nothing is lost when it does.
applying needs: DESCRIBE and DESCRIBE_CONFIGS on the topics it reads; DELETE on TOPIC payments.settled; DELETE on TOPIC orders.created; DELETE on TOPIC customers.updated
3 changes, 3 destroy
applied [+] done delete payments.settled [+] done delete orders.created [+] done delete customers.updated
Applied 3 of 3 changessnapshot: ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yamlrollback: ~/.local/state/kurkik/sync/b/b-<time>.rollback.yamlundo: kurkik kafka sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yamlexit 0After the revert, compared with how it was before: Drift: 0 changed · 0 unmanaged · 0 missing (no drift) - 11 matched
The documents
Section titled “The documents”source.yaml, 150 lines
asyncapi: 3.0.0info: title: a Apache Kafka API version: 1.0.0-SNAPSHOT description: "Generated by reading the a cluster. Cluster id: MkU3OEVBNTcwNTJENDM2Qk."servers: broker-1: host: a-kafka-1:9092 protocol: kafka protocolVersion: "4.4" x-kurkik: kafka: server: security: - security: PLAINTEXT securityProtocol: PLAINTEXT acl: [] groups: [] brokerConfiguration: advertised.listeners: "INTERNAL://kafka-1:19092,EXTERNAL://a-kafka-1:9092" authorizer.class.name: org.apache.kafka.metadata.authorizer.StandardAuthorizer broker.id: "1" controller.listener.names: CONTROLLER controller.quorum.voters: 1@kafka-1:9093 group.initial.rebalance.delay.ms: "0" inter.broker.listener.name: INTERNAL listener.security.protocol.map: "INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT,CONTROLLER:PLAINTEXT" listeners: "INTERNAL://0.0.0.0:19092,EXTERNAL://0.0.0.0:9092,CONTROLLER://0.0.0.0:9093" min.insync.replicas: "1" node.id: "1" offsets.topic.replication.factor: "1" process.roles: "broker,controller" transaction.state.log.min.isr: "1" transaction.state.log.replication.factor: "1" clientConfiguration: bootstrap.servers: a-kafka-1:9092 security.protocol: PLAINTEXT groupConfiguration: {} producerConfiguration: {} consumerConfiguration: {}channels: customers.updated: address: customers.updated bindings: kafka: bindingVersion: 0.5.0 partitions: 3 replicas: 1 topicConfiguration: cleanup.policy: - compact x-kurkik: kafka: channel: topic: customers.updated partitions: 3 replicas: 1 topicConfiguration: cleanup.policy: compact orders.created: address: orders.created bindings: kafka: bindingVersion: 0.5.0 partitions: 3 replicas: 1 topicConfiguration: retention.ms: 604800000 x-kurkik: kafka: channel: topic: orders.created partitions: 3 replicas: 1 topicConfiguration: retention.ms: "604800000" payments.settled: address: payments.settled bindings: kafka: bindingVersion: 0.5.0 partitions: 3 replicas: 1 x-kurkik: kafka: channel: topic: payments.settled partitions: 3 replicas: 1 topicConfiguration: min.insync.replicas: "1" retention.bytes: "10737418240"operations: receive_customers.updated: action: receive channel: $ref: "#/channels/customers.updated" x-kurkik: kafka: operation: security: [] consumerConfiguration: {} groupConfiguration: {} receive_orders.created: action: receive channel: $ref: "#/channels/orders.created" x-kurkik: kafka: operation: security: [] consumerConfiguration: {} groupConfiguration: {} receive_payments.settled: action: receive channel: $ref: "#/channels/payments.settled" x-kurkik: kafka: operation: security: [] consumerConfiguration: {} groupConfiguration: {} send_customers.updated: action: send channel: $ref: "#/channels/customers.updated" x-kurkik: kafka: operation: security: [] producerConfiguration: {} send_orders.created: action: send channel: $ref: "#/channels/orders.created" x-kurkik: kafka: operation: security: [] producerConfiguration: {} send_payments.settled: action: send channel: $ref: "#/channels/payments.settled" x-kurkik: kafka: operation: security: [] producerConfiguration: {}How to build this setup yourself
Brokers
Cluster a
kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic orders.created --partitions 3 --replication-factor 1 --config retention.ms=604800000kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic payments.settled --partitions 3 --replication-factor 1 --config min.insync.replicas=1 --config retention.bytes=10737418240kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic customers.updated --partitions 3 --replication-factor 1 --config cleanup.policy=compactCluster b
Sync
kurkik conn add kafka a --bootstrap a-kafka-1:9092kurkik conn add kafka b --bootstrap b-kafka-1:9092kurkik kafka export a --acls --groups --stdout > a.yaml # source.yamlkurkik kafka sync a.yaml b --dry-run # plan.txt (and -o json: plan.json)kurkik kafka sync a.yaml b --yes # apply.txt, and the rollback: rollback.yamlkurkik kafka sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml b --force --yes # revert.txtOther broker setups
Section titled “Other broker setups”Three brokers, alike
Section titled “Three brokers, alike”Show the plan
$ kurkik kafka sync a.yaml b --dry-runSync a.yaml into b - Apache Kafka, cluster MkU3OEVBNTcwNTJENDM2Qkowns: the whole cluster - the document names no x-kurkik.kafka.server.topicPrefixes; access, as x-kurkik.kafka.server.acl declares itplan: <digest>Run one sync per cluster at a time: two at once each plan against a state the other is changing.
changes (3) + create customers.updated + create orders.created + create payments.settled
left alone (12) not decided receive_customers.updated groupId Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_customers.updated' declares no consumer group, so there is nothing a broker could confirm. not decided receive_orders.created groupId Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_orders.created' declares no consumer group, so there is nothing a broker could confirm. not decided receive_payments.settled groupId Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_payments.settled' declares no consumer group, so there is nothing a broker could confirm. not decided send_customers.updated action Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'customers.updated', so operation 'send_customers.updated' is not checked. not decided send_orders.created action Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'orders.created', so operation 'send_orders.created' is not checked. not decided send_payments.settled action Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'payments.settled', so operation 'send_payments.settled' is not checked. and 6 differences sync does not act on - servers, messages, undeclared settings; kurkik kafka diff shows them
applying needs: DESCRIBE and DESCRIBE_CONFIGS on the topics it reads; CREATE on TOPIC customers.updated (or on the CLUSTER); CREATE on TOPIC orders.created (or on the CLUSTER); CREATE on TOPIC payments.settled (or on the CLUSTER)
3 changes
rehearsal [+] done create customers.updated [+] done create orders.created [+] done create payments.settled
The cluster would accept every request it was shown. Nothing was changed.exit 2How to build this setup yourself
Brokers
Cluster a
kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic orders.created --partitions 3 --replication-factor 3 --config retention.ms=604800000kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic payments.settled --partitions 3 --replication-factor 3 --config min.insync.replicas=1 --config retention.bytes=10737418240kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic customers.updated --partitions 3 --replication-factor 3 --config cleanup.policy=compactCluster b
Sync
kurkik conn add kafka a --bootstrap a-kafka-1:9092,a-kafka-2:9092,a-kafka-3:9092kurkik conn add kafka b --bootstrap b-kafka-1:9092,b-kafka-2:9092,b-kafka-3:9092kurkik kafka export a --acls --groups --stdout > a.yaml # source.yamlkurkik kafka sync a.yaml b --dry-run # plan.txt (and -o json: plan.json)kurkik kafka sync a.yaml b --yes # apply.txt, and the rollback: rollback.yamlkurkik kafka sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml b --force --yes # revert.txtThree brokers that differ
Section titled “Three brokers that differ”Show the plan
$ kurkik kafka sync a.yaml b --dry-runSync a.yaml into b - Apache Kafka, cluster MkU3OEVBNTcwNTJENDM2Qkowns: the whole cluster - the document names no x-kurkik.kafka.server.topicPrefixes; access, as x-kurkik.kafka.server.acl declares itplan: <digest>Run one sync per cluster at a time: two at once each plan against a state the other is changing.
changes (3) + create customers.updated + create orders.created + create payments.settled
left alone (12) not decided receive_customers.updated groupId Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_customers.updated' declares no consumer group, so there is nothing a broker could confirm. not decided receive_orders.created groupId Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_orders.created' declares no consumer group, so there is nothing a broker could confirm. not decided receive_payments.settled groupId Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_payments.settled' declares no consumer group, so there is nothing a broker could confirm. not decided send_customers.updated action Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'customers.updated', so operation 'send_customers.updated' is not checked. not decided send_orders.created action Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'orders.created', so operation 'send_orders.created' is not checked. not decided send_payments.settled action Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'payments.settled', so operation 'send_payments.settled' is not checked. and 6 differences sync does not act on - servers, messages, undeclared settings; kurkik kafka diff shows them
applying needs: DESCRIBE and DESCRIBE_CONFIGS on the topics it reads; CREATE on TOPIC customers.updated (or on the CLUSTER); CREATE on TOPIC orders.created (or on the CLUSTER); CREATE on TOPIC payments.settled (or on the CLUSTER)
3 changes
rehearsal [+] done create customers.updated [+] done create orders.created [+] done create payments.settled
The cluster would accept every request it was shown. Nothing was changed.exit 2How to build this setup yourself
Brokers
Cluster a
kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic orders.created --partitions 3 --replication-factor 3 --config retention.ms=604800000kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic payments.settled --replica-assignment 2,2 --config min.insync.replicas=1 --config retention.bytes=10737418240kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic customers.updated --replica-assignment 1:3 --config cleanup.policy=compactCluster b
Sync
kurkik conn add kafka a --bootstrap a-kafka-1:9092,a-kafka-2:9092,a-kafka-3:9092kurkik conn add kafka b --bootstrap b-kafka-1:9092,b-kafka-2:9092,b-kafka-3:9092kurkik kafka export a --acls --groups --stdout > a.yaml # source.yamlkurkik kafka sync a.yaml b --dry-run # plan.txt (and -o json: plan.json)kurkik kafka sync a.yaml b --yes # apply.txt, and the rollback: rollback.yamlkurkik kafka sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml b --force --yes # revert.txtAll flags: kurkik kafka sync · more Apache Kafka sync examples
Copyright © 2026 Pavel Bodiachevskii