Skip to content

Migrate a whole Kafka cluster setup in one sync

Topics, settings, ACLs, groups and schemas all differ. One plan, one apply, one revert.

Terminal recording of kurkik kafka sync

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.

Nothing changes yet. --dry-run only shows what would happen.

$ kurkik kafka sync a.yaml b --all --overwrite --revoke --delete --accept-groups --dry-run
Sync a.yaml into b - Apache Kafka, cluster MkU3OEVBNTcwNTJENDM2Qk
owns: the whole cluster - the document names no x-kurkik.kafka.server.topicPrefixes; access, as x-kurkik.kafka.server.acl declares it
plan: <digest>
Run one sync per cluster at a time: two at once each plan against a state the other is changing.
changes (10)
+ create customers.updated
~ set orders.created retention.ms 604800000 -> 86400000 [destroys messages]
Kafka applies the new bound promptly, so retention.ms going from 604800000 to 86400000 deletes what no longer fits.
+ grant ALLOW User:analytics READ on TOPIC customers.updated acl (not set) -> ALLOW User:analytics READ on TOPIC customers.updated
~ set every broker message.max.bytes (default) -> 2097152
~ set group audit consumer.heartbeat.interval.ms (not set) -> 6000
Group audit is not on the cluster: Kafka keeps its settings by id, and the group appears when a consumer joins it, with no committed positions.
+ register customers.updated-value value (not set) -> customers.updated-value
Registers 1 version(s) of customers.updated-value (Protobuf) in order, then sets its compatibility to NONE.
+ register orders.created-value version 2 (not set) -> v2 Avro
Appended to orders.created-value after the versions it has; the registry checks it against them at the subject's compatibility level.
- delete legacy.events [destroys messages]
Every message in legacy.events is deleted, and every consumer group's position in it.
- revoke ALLOW User:stale READ on TOPIC orders.created acl ALLOW User:stale READ on TOPIC orders.created -> (not set) [revokes access]
User:stale loses READ on orders.created; a client relying on it fails from then on.
- delete group legacy-report [deletes the group's committed positions]
legacy-report's 1 committed position(s) go with it; the rollback commits them again. Its own settings stay with Kafka.
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.
note: Group sync: Kafka holds no group without members or committed positions. A group the document describes is made by writing its own settings, which Kafka keeps by the group's id; the group itself appears only when a consumer joins it, and starts with no committed positions - its consumers begin where auto.offset.reset says. No position is ever copied from the document's cluster. A group with nothing of its own to write cannot be made at all. With --delete, empty groups the document does not describe are deleted with their positions; the rollback commits those again (Kafka then makes it a classic group until a consumer of another protocol joins).
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 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 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 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.
not held group audit groupId
Kafka keeps no group without members or committed positions, so audit itself is not made: its own settings are written (below), and it appears when a consumer joins it, with no committed positions.
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); ALTER_CONFIGS on TOPIC orders.created; ALTER on CLUSTER; ALTER_CONFIGS on CLUSTER; ALTER_CONFIGS on GROUP audit; write access to the schema registry's subject customers.updated-value; write access to the schema registry's subject orders.created-value; DELETE on TOPIC legacy.events; DELETE on GROUP legacy-report
10 changes, 4 destroy
rehearsal
[?] not attempted grant ALLOW User:analytics READ on TOPIC customers.updated acl (not set) -> ALLOW User:analytics READ on TOPIC customers.updated
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted register customers.updated-value value (not set) -> customers.updated-value
not rehearsed: it has no validate-only form
[?] not attempted register orders.created-value version 2 (not set) -> v2 Avro
not rehearsed: it has no validate-only form
[?] not attempted delete legacy.events
not rehearsed: a dry run sends no deletion
[?] not attempted revoke ALLOW User:stale READ on TOPIC orders.created acl ALLOW User:stale READ on TOPIC orders.created -> (not set)
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted delete group legacy-report
not rehearsed: it has no validate-only form
[+] done create customers.updated
[+] done set orders.created retention.ms 604800000 -> 86400000
[+] done set every broker message.max.bytes (default) -> 2097152
[+] done set group audit consumer.heartbeat.interval.ms (not set) -> 6000
The cluster would accept every request it was shown. 6 could not be rehearsed - Kafka has no validate-only deletion or ACL change, and a schema registry no validate-only write. Nothing was changed.
exit 2
$ kurkik kafka sync a.yaml b --all --overwrite --revoke --delete --accept-groups --yes
Sync a.yaml into b - Apache Kafka, cluster MkU3OEVBNTcwNTJENDM2Qk
owns: the whole cluster - the document names no x-kurkik.kafka.server.topicPrefixes; access, as x-kurkik.kafka.server.acl declares it
plan: <digest>
Run one sync per cluster at a time: two at once each plan against a state the other is changing.
changes (10)
+ create customers.updated
~ set orders.created retention.ms 604800000 -> 86400000 [destroys messages]
Kafka applies the new bound promptly, so retention.ms going from 604800000 to 86400000 deletes what no longer fits.
+ grant ALLOW User:analytics READ on TOPIC customers.updated acl (not set) -> ALLOW User:analytics READ on TOPIC customers.updated
~ set every broker message.max.bytes (default) -> 2097152
~ set group audit consumer.heartbeat.interval.ms (not set) -> 6000
Group audit is not on the cluster: Kafka keeps its settings by id, and the group appears when a consumer joins it, with no committed positions.
+ register customers.updated-value value (not set) -> customers.updated-value
Registers 1 version(s) of customers.updated-value (Protobuf) in order, then sets its compatibility to NONE.
+ register orders.created-value version 2 (not set) -> v2 Avro
Appended to orders.created-value after the versions it has; the registry checks it against them at the subject's compatibility level.
- delete legacy.events [destroys messages]
Every message in legacy.events is deleted, and every consumer group's position in it.
- revoke ALLOW User:stale READ on TOPIC orders.created acl ALLOW User:stale READ on TOPIC orders.created -> (not set) [revokes access]
User:stale loses READ on orders.created; a client relying on it fails from then on.
- delete group legacy-report [deletes the group's committed positions]
legacy-report's 1 committed position(s) go with it; the rollback commits them again. Its own settings stay with Kafka.
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.
note: Group sync: Kafka holds no group without members or committed positions. A group the document describes is made by writing its own settings, which Kafka keeps by the group's id; the group itself appears only when a consumer joins it, and starts with no committed positions - its consumers begin where auto.offset.reset says. No position is ever copied from the document's cluster. A group with nothing of its own to write cannot be made at all. With --delete, empty groups the document does not describe are deleted with their positions; the rollback commits those again (Kafka then makes it a classic group until a consumer of another protocol joins).
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 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 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 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.
not held group audit groupId
Kafka keeps no group without members or committed positions, so audit itself is not made: its own settings are written (below), and it appears when a consumer joins it, with no committed positions.
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); ALTER_CONFIGS on TOPIC orders.created; ALTER on CLUSTER; ALTER_CONFIGS on CLUSTER; ALTER_CONFIGS on GROUP audit; write access to the schema registry's subject customers.updated-value; write access to the schema registry's subject orders.created-value; DELETE on TOPIC legacy.events; DELETE on GROUP legacy-report
10 changes, 4 destroy
applied
[+] done create customers.updated
[+] done set orders.created retention.ms 604800000 -> 86400000
[+] done grant ALLOW User:analytics READ on TOPIC customers.updated acl (not set) -> ALLOW User:analytics READ on TOPIC customers.updated
[+] done set every broker message.max.bytes (default) -> 2097152
[+] done set group audit consumer.heartbeat.interval.ms (not set) -> 6000
[+] done register customers.updated-value value (not set) -> customers.updated-value
[+] done register orders.created-value version 2 (not set) -> v2 Avro
[+] done delete legacy.events
[+] done revoke ALLOW User:stale READ on TOPIC orders.created acl ALLOW User:stale READ on TOPIC orders.created -> (not set)
[+] done delete group legacy-report
Applied 10 of 10 changes - 8 left alone
snapshot: ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml
rollback: ~/.local/state/kurkik/sync/b/b-<time>.rollback.yaml
undo: kurkik kafka sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml
exit 0

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: "set-setting:orders.created:retention.ms"
undo: "SET_SETTING"
target: "orders.created"
field: "retention.ms"
preState:
value: "604800000"
override: true
- forAction: "grant-access:ALLOW User:analytics READ on TOPIC customers.updated:acl"
undo: "REVOKE_GRANTED_ACCESS"
target: "ALLOW User:analytics READ on TOPIC customers.updated"
field: "acl"
note: "sync granted this. Revoking it again cuts off whoever has started to rely\
\ on it."
definition:
host: "*"
name: "customers.updated"
operation: "READ"
patternType: "LITERAL"
permission: "ALLOW"
principal: "User:analytics"
resourceType: "TOPIC"
- forAction: "set-setting:cluster:message.max.bytes"
undo: "REMOVE_SETTING_OVERRIDE"
target: "cluster"
field: "message.max.bytes"
preState:
override: false
note: "The system had no setting of its own here, so undoing means removing one."
definition:
scope: "BROKER_CONFIGURATION"
- forAction: "set-setting:audit:consumer.heartbeat.interval.ms"
undo: "REMOVE_SETTING_OVERRIDE"
target: "audit"
field: "consumer.heartbeat.interval.ms"
preState:
override: false
note: "The system had no setting of its own here, so undoing means removing one."
definition:
scope: "GROUP"
- forAction: "register-schema:customers.updated:value"
undo: "DELETE_REGISTERED_SCHEMA"
target: "customers.updated"
field: "value"
note: "sync registered this. Undoing it soft-deletes the version again."
definition:
"1.format": "PROTOBUF"
"1.schema": "syntax = \"proto3\";\npackage com.shop.customers;\n\nmessage Customer\
\ {\n string id = 1;\n string email = 2;\n}\n"
compatibility: "NONE"
count: "1"
part: "VALUE"
registered: "1"
subject: "customers.updated-value"
- forAction: "register-schema:orders.created:version 2"
undo: "DELETE_REGISTERED_SCHEMA"
target: "orders.created"
field: "version 2"
note: "sync registered this. Undoing it soft-deletes the version again."
definition:
"1.format": "AVRO"
"1.schema": "{\"type\":\"record\",\"name\":\"OrderCreated\",\"namespace\":\"com.shop.orders\"\
,\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"total\",\"type\"\
:\"long\"},{\"name\":\"note\",\"type\":[\"null\",\"string\"],\"default\":null}]}"
"1.version": "2"
count: "1"
part: "VALUE"
position: "2"
registered: "2"
subject: "orders.created-value"
- forAction: "delete-channel:legacy.events"
undo: "RECREATE_DELETED_CHANNEL"
target: "legacy.events"
note: "sync deleted this. It can be made again as it was; its messages cannot."
definition:
partitions: "3"
replicas: "1"
- forAction: "revoke-access:ALLOW User:stale READ on TOPIC orders.created:acl"
undo: "RESTORE_ACCESS"
target: "ALLOW User:stale READ on TOPIC orders.created"
field: "acl"
preState:
value: "ALLOW User:stale READ on TOPIC orders.created"
override: true
definition:
host: "*"
name: "orders.created"
operation: "READ"
patternType: "LITERAL"
permission: "ALLOW"
principal: "User:stale"
resourceType: "TOPIC"
- forAction: "delete-group:legacy-report"
undo: "RESTORE_DELETED_GROUP"
target: "legacy-report"
note: "sync deleted this group. Its committed positions can be committed again;\
\ it comes back with nobody in it."
definition:
groupId: "legacy-report"
groupType: "classic"
offset.0.orders.created: "0"

Download rollback.yaml

$ kurkik kafka sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml b --force --yes
Revert b to b-<time>.snapshot.yaml - Apache Kafka, cluster MkU3OEVBNTcwNTJENDM2Qk
owns: what the run being undone changed, as its rollback records it
plan: <digest>
Run one sync per cluster at a time: two at once each plan against a state the other is changing.
changes (10)
+ restore group legacy-report
Commits 1 position(s) of legacy-report again. Kafka makes such a group a classic one until a consumer of another protocol joins it.
+ grant ALLOW User:stale READ on TOPIC orders.created acl
+ create legacy.events
- soft-del orders.created-value version 2 v2 -> (not set) [soft-deletes schema versions]
Soft-deletes what sync registered in orders.created-value; a client that resolved one of them by id still can, by version it cannot.
- soft-del customers.updated-value value v1 -> (not set) [soft-deletes schema versions]
Soft-deletes what sync registered in customers.updated-value; a client that resolved one of them by id still can, by version it cannot.
~ unset group audit consumer.heartbeat.interval.ms 6000 -> (default)
~ unset every broker message.max.bytes 2097152 -> (default)
- revoke ALLOW User:analytics READ on TOPIC customers.updated acl [revokes access]
User:analytics loses what sync granted it; a client that has started relying on it fails.
~ set orders.created retention.ms 86400000 -> 604800000
- 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.
note: Group sync: Kafka holds no group without members or committed positions. A group the document describes is made by writing its own settings, which Kafka keeps by the group's id; the group itself appears only when a consumer joins it, and starts with no committed positions - its consumers begin where auto.offset.reset says. No position is ever copied from the document's cluster. A group with nothing of its own to write cannot be made at all. With --delete, empty groups the document does not describe are deleted with their positions; the rollback commits those again (Kafka then makes it a classic group until a consumer of another protocol joins).
applying needs: DESCRIBE and DESCRIBE_CONFIGS on the topics it reads; READ on GROUP legacy-report and on the topics it read; ALTER on CLUSTER; CREATE on TOPIC legacy.events (or on the CLUSTER); write access to the schema registry's subject orders.created-value; write access to the schema registry's subject customers.updated-value; ALTER_CONFIGS on GROUP audit; ALTER_CONFIGS on CLUSTER; ALTER_CONFIGS on TOPIC orders.created; DELETE on TOPIC customers.updated
10 changes, 4 destroy
applied
[+] done restore group legacy-report
[+] done grant ALLOW User:stale READ on TOPIC orders.created acl
[+] done create legacy.events
[+] done soft-del orders.created-value version 2 v2 -> (not set)
[+] done soft-del customers.updated-value value v1 -> (not set)
[+] done unset group audit consumer.heartbeat.interval.ms 6000 -> (default)
[+] done unset every broker message.max.bytes 2097152 -> (default)
[+] done revoke ALLOW User:analytics READ on TOPIC customers.updated acl
[+] done set orders.created retention.ms 86400000 -> 604800000
[+] done delete customers.updated
Applied 10 of 10 changes
snapshot: ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml
rollback: ~/.local/state/kurkik/sync/b/b-<time>.rollback.yaml
undo: kurkik kafka sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml
exit 0

After the revert, compared with how it was before: Drift: 0 changed · 0 unmanaged · 0 missing (no drift) - 36 matched

source.yaml, 294 lines
asyncapi: 3.0.0
info:
title: a Apache Kafka API
version: 1.0.0-SNAPSHOT
description: |-
Generated by reading the a cluster. Cluster id: MkU3OEVBNTcwNTJENDM2Qk.
Some of what this document describes could not be read, so it may be incomplete:
- No value schema is registered for payments.settled (expected subject payments.settled-value).
servers:
broker-1:
host: a-kafka-1:9092
protocol: kafka
protocolVersion: "4.4"
bindings:
kafka:
bindingVersion: 0.5.0
schemaRegistryUrl: http://registry-a:8080
schemaRegistryVendor: apicurio
x-kurkik:
kafka:
server:
schemaRegistryUrl: http://registry-a:8080
schemaRegistryVendor: apicurio
security:
- security: PLAINTEXT
securityProtocol: PLAINTEXT
acl:
- principal: User:analytics
host: '*'
operation: READ
permission: ALLOW
resourceType: TOPIC
patternType: LITERAL
name: customers.updated
- principal: User:billing
host: '*'
operation: READ
permission: ALLOW
resourceType: TOPIC
patternType: LITERAL
name: orders.created
groups:
- groupId: audit
groupType: consumer
state: STABLE
clientIds:
- audit-1
topics:
- orders.created
configuration:
consumer.heartbeat.interval.ms: "6000"
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"
message.max.bytes: "2097152"
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
messages:
customers.updated-value:
payload:
schemaFormat: application/vnd.google.protobuf;version=3
schema: |
syntax = "proto3";
package com.shop.customers;
message Customer {
string id = 1;
string email = 2;
}
name: customers.updated-value
title: customers.updated
summary: "Schema read from the Apicurio Registry: subject customers.updated-value,\
\ version 1."
bindings:
kafka:
bindingVersion: 0.5.0
schemaIdLocation: header
schemaLookupStrategy: TopicIdStrategy
x-kurkik:
kafka:
message:
schemaIdLocation: header
schemaLookupStrategy: TopicIdStrategy
schemaCompatibility: NONE
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
messages:
orders.created-value:
payload:
schemaFormat: application/vnd.apache.avro;version=1.9.0
schema:
type: record
name: OrderCreated
namespace: com.shop.orders
fields:
- name: id
type: string
- name: total
type: long
- name: note
type:
- "null"
- string
default: null
name: orders.created-value
title: orders.created
summary: "Schema read from the Apicurio Registry: subject orders.created-value,\
\ version 2."
bindings:
kafka:
bindingVersion: 0.5.0
schemaIdLocation: header
schemaLookupStrategy: TopicIdStrategy
x-kurkik:
kafka:
message:
schemaIdLocation: header
schemaLookupStrategy: TopicIdStrategy
schemaCompatibility: NONE
schemaVersions:
- version: 1
schemaFormat: application/vnd.apache.avro;version=1.9.0
schema:
type: record
name: OrderCreated
namespace: com.shop.orders
fields:
- name: id
type: string
- name: total
type: long
- version: 2
schemaFormat: application/vnd.apache.avro;version=1.9.0
schema:
type: record
name: OrderCreated
namespace: com.shop.orders
fields:
- name: id
type: string
- name: total
type: long
- name: note
type:
- "null"
- string
default: null
bindings:
kafka:
bindingVersion: 0.5.0
partitions: 3
replicas: 1
topicConfiguration:
retention.ms: 86400000
x-kurkik:
kafka:
channel:
topic: orders.created
partitions: 3
replicas: 1
topicConfiguration:
retention.ms: "86400000"
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:
- User:analytics
consumerConfiguration: {}
groupConfiguration: {}
receive_orders.created:
action: receive
channel:
$ref: "#/channels/orders.created"
bindings:
kafka:
bindingVersion: 0.5.0
groupId:
$schema: http://json-schema.org/draft-07/schema#
enum:
- audit
clientId:
$schema: http://json-schema.org/draft-07/schema#
enum:
- audit-1
x-kurkik:
kafka:
operation:
groupId:
$schema: http://json-schema.org/draft-07/schema#
enum:
- audit
clientId:
$schema: http://json-schema.org/draft-07/schema#
enum:
- audit-1
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: {}

Download source.yaml

How to build this setup yourself

Brokers

Cluster a

Terminal window
kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic orders.created --partitions 3 --replication-factor 1 --config retention.ms=604800000
kafka-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=10737418240
kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic customers.updated --partitions 3 --replication-factor 1 --config cleanup.policy=compact
kafka-configs.sh --bootstrap-server a-kafka-1:9092 --entity-type topics --entity-name orders.created --alter --add-config retention.ms=86400000
kafka-configs.sh --bootstrap-server a-kafka-1:9092 --entity-type brokers --entity-default --alter --add-config message.max.bytes=2097152
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:billing --operation Read --topic orders.created
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:analytics --operation Read --topic customers.updated
kafka-console-consumer.sh --bootstrap-server a-kafka-1:9092 --group audit --consumer-property client.id=audit-1 --consumer-property group.protocol=consumer --include 'orders.created' & # stays connected while kurkik reads
kafka-configs.sh --bootstrap-server a-kafka-1:9092 --entity-type groups --entity-name audit --alter --add-config consumer.heartbeat.interval.ms=6000
api=http://registry-a:8080/apis/ccompat/v7; type='Content-Type: application/vnd.schemaregistry.v1+json' # apicurio/apicurio-registry-mem:2.6.5.Final
curl -X POST -H "$type" "$api/subjects/orders.created-value/versions" --data '{"schemaType":"AVRO","schema":"{\"type\":\"record\",\"name\":\"OrderCreated\",\"namespace\":\"com.shop.orders\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"total\",\"type\":\"long\"}]}"}'
curl -X POST -H "$type" "$api/subjects/orders.created-value/versions" --data '{"schemaType":"AVRO","schema":"{\"type\":\"record\",\"name\":\"OrderCreated\",\"namespace\":\"com.shop.orders\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"total\",\"type\":\"long\"},{\"name\":\"note\",\"type\":[\"null\",\"string\"],\"default\":null}]}"}'
curl -X POST -H "$type" "$api/subjects/customers.updated-value/versions" --data '{"schemaType":"PROTOBUF","schema":"syntax = \"proto3\";\npackage com.shop.customers;\n\nmessage Customer {\n string id = 1;\n string email = 2;\n}\n"}'

Cluster b

Terminal window
kafka-topics.sh --bootstrap-server b-kafka-1:9092 --create --topic orders.created --partitions 3 --replication-factor 1 --config retention.ms=604800000
kafka-topics.sh --bootstrap-server b-kafka-1:9092 --create --topic payments.settled --partitions 3 --replication-factor 1 --config min.insync.replicas=1 --config retention.bytes=10737418240
kafka-topics.sh --bootstrap-server b-kafka-1:9092 --create --topic legacy.events --partitions 3 --replication-factor 1
kafka-acls.sh --bootstrap-server b-kafka-1:9092 --add --allow-principal User:billing --operation Read --topic orders.created
kafka-acls.sh --bootstrap-server b-kafka-1:9092 --add --allow-principal User:stale --operation Read --topic orders.created
kafka-consumer-groups.sh --bootstrap-server b-kafka-1:9092 --group legacy-report --topic orders.created:0 --reset-offsets --to-offset 0 --execute
api=http://registry-b:8080/apis/ccompat/v7; type='Content-Type: application/vnd.schemaregistry.v1+json' # apicurio/apicurio-registry-mem:2.6.5.Final
curl -X POST -H "$type" "$api/subjects/orders.created-value/versions" --data '{"schemaType":"AVRO","schema":"{\"type\":\"record\",\"name\":\"OrderCreated\",\"namespace\":\"com.shop.orders\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"total\",\"type\":\"long\"}]}"}'

Sync

Terminal window
kurkik conn add kafka a --bootstrap a-kafka-1:9092 --registry-url http://registry-a:8080 --registry-vendor apicurio
kurkik conn add kafka b --bootstrap b-kafka-1:9092 --registry-url http://registry-b:8080 --registry-vendor apicurio
kurkik kafka export a --acls --groups --stdout > a.yaml # source.yaml
kurkik kafka sync a.yaml b --all --overwrite --revoke --delete --accept-groups --dry-run # plan.txt (and -o json: plan.json)
kurkik kafka sync a.yaml b --all --overwrite --revoke --delete --accept-groups --yes # apply.txt, and the rollback: rollback.yaml
kurkik kafka sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml b --force --yes # revert.txt
Show the plan
$ kurkik kafka sync a.yaml b --all --overwrite --revoke --delete --accept-groups --dry-run
Sync a.yaml into b - Apache Kafka, cluster MkU3OEVBNTcwNTJENDM2Qk
owns: the whole cluster - the document names no x-kurkik.kafka.server.topicPrefixes; access, as x-kurkik.kafka.server.acl declares it
plan: <digest>
Run one sync per cluster at a time: two at once each plan against a state the other is changing.
changes (10)
+ create customers.updated
~ set orders.created retention.ms 604800000 -> 86400000 [destroys messages]
Kafka applies the new bound promptly, so retention.ms going from 604800000 to 86400000 deletes what no longer fits.
+ grant ALLOW User:analytics READ on TOPIC customers.updated acl (not set) -> ALLOW User:analytics READ on TOPIC customers.updated
~ set every broker message.max.bytes (default) -> 2097152
~ set group audit consumer.heartbeat.interval.ms (not set) -> 6000
Group audit is not on the cluster: Kafka keeps its settings by id, and the group appears when a consumer joins it, with no committed positions.
+ register customers.updated-value value (not set) -> customers.updated-value
Registers 1 version(s) of customers.updated-value (Protobuf) in order, then sets its compatibility to NONE.
+ register orders.created-value version 2 (not set) -> v2 Avro
Appended to orders.created-value after the versions it has; the registry checks it against them at the subject's compatibility level.
- delete legacy.events [destroys messages]
Every message in legacy.events is deleted, and every consumer group's position in it.
- revoke ALLOW User:stale READ on TOPIC orders.created acl ALLOW User:stale READ on TOPIC orders.created -> (not set) [revokes access]
User:stale loses READ on orders.created; a client relying on it fails from then on.
- delete group legacy-report [deletes the group's committed positions]
legacy-report's 1 committed position(s) go with it; the rollback commits them again. Its own settings stay with Kafka.
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.
note: Group sync: Kafka holds no group without members or committed positions. A group the document describes is made by writing its own settings, which Kafka keeps by the group's id; the group itself appears only when a consumer joins it, and starts with no committed positions - its consumers begin where auto.offset.reset says. No position is ever copied from the document's cluster. A group with nothing of its own to write cannot be made at all. With --delete, empty groups the document does not describe are deleted with their positions; the rollback commits those again (Kafka then makes it a classic group until a consumer of another protocol joins).
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 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 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 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.
not held group audit groupId
Kafka keeps no group without members or committed positions, so audit itself is not made: its own settings are written (below), and it appears when a consumer joins it, with no committed positions.
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); ALTER_CONFIGS on TOPIC orders.created; ALTER on CLUSTER; ALTER_CONFIGS on CLUSTER; ALTER_CONFIGS on GROUP audit; write access to the schema registry's subject customers.updated-value; write access to the schema registry's subject orders.created-value; DELETE on TOPIC legacy.events; DELETE on GROUP legacy-report
10 changes, 4 destroy
rehearsal
[?] not attempted grant ALLOW User:analytics READ on TOPIC customers.updated acl (not set) -> ALLOW User:analytics READ on TOPIC customers.updated
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted register customers.updated-value value (not set) -> customers.updated-value
not rehearsed: it has no validate-only form
[?] not attempted register orders.created-value version 2 (not set) -> v2 Avro
not rehearsed: it has no validate-only form
[?] not attempted delete legacy.events
not rehearsed: a dry run sends no deletion
[?] not attempted revoke ALLOW User:stale READ on TOPIC orders.created acl ALLOW User:stale READ on TOPIC orders.created -> (not set)
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted delete group legacy-report
not rehearsed: it has no validate-only form
[+] done create customers.updated
[+] done set orders.created retention.ms 604800000 -> 86400000
[+] done set every broker message.max.bytes (default) -> 2097152
[+] done set group audit consumer.heartbeat.interval.ms (not set) -> 6000
The cluster would accept every request it was shown. 6 could not be rehearsed - Kafka has no validate-only deletion or ACL change, and a schema registry no validate-only write. Nothing was changed.
exit 2

Download

How to build this setup yourself

Brokers

Cluster a

Terminal window
kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic orders.created --partitions 3 --replication-factor 3 --config retention.ms=604800000
kafka-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=10737418240
kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic customers.updated --partitions 3 --replication-factor 3 --config cleanup.policy=compact
kafka-configs.sh --bootstrap-server a-kafka-1:9092 --entity-type topics --entity-name orders.created --alter --add-config retention.ms=86400000
kafka-configs.sh --bootstrap-server a-kafka-1:9092 --entity-type brokers --entity-default --alter --add-config message.max.bytes=2097152
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:billing --operation Read --topic orders.created
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:analytics --operation Read --topic customers.updated
kafka-console-consumer.sh --bootstrap-server a-kafka-1:9092 --group audit --consumer-property client.id=audit-1 --consumer-property group.protocol=consumer --include 'orders.created' & # stays connected while kurkik reads
kafka-configs.sh --bootstrap-server a-kafka-1:9092 --entity-type groups --entity-name audit --alter --add-config consumer.heartbeat.interval.ms=6000
api=http://registry-a:8080/apis/ccompat/v7; type='Content-Type: application/vnd.schemaregistry.v1+json' # apicurio/apicurio-registry-mem:2.6.5.Final
curl -X POST -H "$type" "$api/subjects/orders.created-value/versions" --data '{"schemaType":"AVRO","schema":"{\"type\":\"record\",\"name\":\"OrderCreated\",\"namespace\":\"com.shop.orders\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"total\",\"type\":\"long\"}]}"}'
curl -X POST -H "$type" "$api/subjects/orders.created-value/versions" --data '{"schemaType":"AVRO","schema":"{\"type\":\"record\",\"name\":\"OrderCreated\",\"namespace\":\"com.shop.orders\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"total\",\"type\":\"long\"},{\"name\":\"note\",\"type\":[\"null\",\"string\"],\"default\":null}]}"}'
curl -X POST -H "$type" "$api/subjects/customers.updated-value/versions" --data '{"schemaType":"PROTOBUF","schema":"syntax = \"proto3\";\npackage com.shop.customers;\n\nmessage Customer {\n string id = 1;\n string email = 2;\n}\n"}'

Cluster b

Terminal window
kafka-topics.sh --bootstrap-server b-kafka-1:9092 --create --topic orders.created --partitions 3 --replication-factor 3 --config retention.ms=604800000
kafka-topics.sh --bootstrap-server b-kafka-1:9092 --create --topic payments.settled --partitions 3 --replication-factor 3 --config min.insync.replicas=1 --config retention.bytes=10737418240
kafka-topics.sh --bootstrap-server b-kafka-1:9092 --create --topic legacy.events --partitions 3 --replication-factor 3
kafka-acls.sh --bootstrap-server b-kafka-1:9092 --add --allow-principal User:billing --operation Read --topic orders.created
kafka-acls.sh --bootstrap-server b-kafka-1:9092 --add --allow-principal User:stale --operation Read --topic orders.created
kafka-consumer-groups.sh --bootstrap-server b-kafka-1:9092 --group legacy-report --topic orders.created:0 --reset-offsets --to-offset 0 --execute
api=http://registry-b:8080/apis/ccompat/v7; type='Content-Type: application/vnd.schemaregistry.v1+json' # apicurio/apicurio-registry-mem:2.6.5.Final
curl -X POST -H "$type" "$api/subjects/orders.created-value/versions" --data '{"schemaType":"AVRO","schema":"{\"type\":\"record\",\"name\":\"OrderCreated\",\"namespace\":\"com.shop.orders\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"total\",\"type\":\"long\"}]}"}'

Sync

Terminal window
kurkik conn add kafka a --bootstrap a-kafka-1:9092,a-kafka-2:9092,a-kafka-3:9092 --registry-url http://registry-a:8080 --registry-vendor apicurio
kurkik conn add kafka b --bootstrap b-kafka-1:9092,b-kafka-2:9092,b-kafka-3:9092 --registry-url http://registry-b:8080 --registry-vendor apicurio
kurkik kafka export a --acls --groups --stdout > a.yaml # source.yaml
kurkik kafka sync a.yaml b --all --overwrite --revoke --delete --accept-groups --dry-run # plan.txt (and -o json: plan.json)
kurkik kafka sync a.yaml b --all --overwrite --revoke --delete --accept-groups --yes # apply.txt, and the rollback: rollback.yaml
kurkik kafka sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml b --force --yes # revert.txt
Show the plan
$ kurkik kafka sync a.yaml b --all --overwrite --revoke --delete --accept-groups --dry-run
Sync a.yaml into b - Apache Kafka, cluster MkU3OEVBNTcwNTJENDM2Qk
owns: the whole cluster - the document names no x-kurkik.kafka.server.topicPrefixes; access, as x-kurkik.kafka.server.acl declares it
plan: <digest>
Run one sync per cluster at a time: two at once each plan against a state the other is changing.
changes (10)
+ create customers.updated
~ set orders.created retention.ms 604800000 -> 86400000 [destroys messages]
Kafka applies the new bound promptly, so retention.ms going from 604800000 to 86400000 deletes what no longer fits.
+ grant ALLOW User:analytics READ on TOPIC customers.updated acl (not set) -> ALLOW User:analytics READ on TOPIC customers.updated
~ set every broker message.max.bytes (default) -> 2097152
~ set group audit consumer.heartbeat.interval.ms (not set) -> 6000
Group audit is not on the cluster: Kafka keeps its settings by id, and the group appears when a consumer joins it, with no committed positions.
+ register customers.updated-value value (not set) -> customers.updated-value
Registers 1 version(s) of customers.updated-value (Protobuf) in order, then sets its compatibility to NONE.
+ register orders.created-value version 2 (not set) -> v2 Avro
Appended to orders.created-value after the versions it has; the registry checks it against them at the subject's compatibility level.
- delete legacy.events [destroys messages]
Every message in legacy.events is deleted, and every consumer group's position in it.
- revoke ALLOW User:stale READ on TOPIC orders.created acl ALLOW User:stale READ on TOPIC orders.created -> (not set) [revokes access]
User:stale loses READ on orders.created; a client relying on it fails from then on.
- delete group legacy-report [deletes the group's committed positions]
legacy-report's 1 committed position(s) go with it; the rollback commits them again. Its own settings stay with Kafka.
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.
note: Group sync: Kafka holds no group without members or committed positions. A group the document describes is made by writing its own settings, which Kafka keeps by the group's id; the group itself appears only when a consumer joins it, and starts with no committed positions - its consumers begin where auto.offset.reset says. No position is ever copied from the document's cluster. A group with nothing of its own to write cannot be made at all. With --delete, empty groups the document does not describe are deleted with their positions; the rollback commits those again (Kafka then makes it a classic group until a consumer of another protocol joins).
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 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 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 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.
not held group audit groupId
Kafka keeps no group without members or committed positions, so audit itself is not made: its own settings are written (below), and it appears when a consumer joins it, with no committed positions.
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); ALTER_CONFIGS on TOPIC orders.created; ALTER on CLUSTER; ALTER_CONFIGS on CLUSTER; ALTER_CONFIGS on GROUP audit; write access to the schema registry's subject customers.updated-value; write access to the schema registry's subject orders.created-value; DELETE on TOPIC legacy.events; DELETE on GROUP legacy-report
10 changes, 4 destroy
rehearsal
[?] not attempted grant ALLOW User:analytics READ on TOPIC customers.updated acl (not set) -> ALLOW User:analytics READ on TOPIC customers.updated
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted register customers.updated-value value (not set) -> customers.updated-value
not rehearsed: it has no validate-only form
[?] not attempted register orders.created-value version 2 (not set) -> v2 Avro
not rehearsed: it has no validate-only form
[?] not attempted delete legacy.events
not rehearsed: a dry run sends no deletion
[?] not attempted revoke ALLOW User:stale READ on TOPIC orders.created acl ALLOW User:stale READ on TOPIC orders.created -> (not set)
not rehearsed: Kafka has no validate-only ACL change
[?] not attempted delete group legacy-report
not rehearsed: it has no validate-only form
[+] done create customers.updated
[+] done set orders.created retention.ms 604800000 -> 86400000
[+] done set every broker message.max.bytes (default) -> 2097152
[+] done set group audit consumer.heartbeat.interval.ms (not set) -> 6000
The cluster would accept every request it was shown. 6 could not be rehearsed - Kafka has no validate-only deletion or ACL change, and a schema registry no validate-only write. Nothing was changed.
exit 2

Download

How to build this setup yourself

Brokers

Cluster a

Terminal window
kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic orders.created --partitions 3 --replication-factor 3 --config retention.ms=604800000
kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic payments.settled --replica-assignment 2,2 --config min.insync.replicas=1 --config retention.bytes=10737418240
kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic customers.updated --replica-assignment 1:3 --config cleanup.policy=compact
kafka-configs.sh --bootstrap-server a-kafka-1:9092 --entity-type topics --entity-name orders.created --alter --add-config retention.ms=86400000
kafka-configs.sh --bootstrap-server a-kafka-1:9092 --entity-type brokers --entity-default --alter --add-config message.max.bytes=2097152
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:billing --operation Read --topic orders.created
kafka-acls.sh --bootstrap-server a-kafka-1:9092 --add --allow-principal User:analytics --operation Read --topic customers.updated
kafka-console-consumer.sh --bootstrap-server a-kafka-1:9092 --group audit --consumer-property client.id=audit-1 --consumer-property group.protocol=consumer --include 'orders.created' & # stays connected while kurkik reads
kafka-configs.sh --bootstrap-server a-kafka-1:9092 --entity-type groups --entity-name audit --alter --add-config consumer.heartbeat.interval.ms=6000
api=http://registry-a:8080/apis/ccompat/v7; type='Content-Type: application/vnd.schemaregistry.v1+json' # apicurio/apicurio-registry-mem:2.6.5.Final
curl -X POST -H "$type" "$api/subjects/orders.created-value/versions" --data '{"schemaType":"AVRO","schema":"{\"type\":\"record\",\"name\":\"OrderCreated\",\"namespace\":\"com.shop.orders\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"total\",\"type\":\"long\"}]}"}'
curl -X POST -H "$type" "$api/subjects/orders.created-value/versions" --data '{"schemaType":"AVRO","schema":"{\"type\":\"record\",\"name\":\"OrderCreated\",\"namespace\":\"com.shop.orders\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"total\",\"type\":\"long\"},{\"name\":\"note\",\"type\":[\"null\",\"string\"],\"default\":null}]}"}'
curl -X POST -H "$type" "$api/subjects/customers.updated-value/versions" --data '{"schemaType":"PROTOBUF","schema":"syntax = \"proto3\";\npackage com.shop.customers;\n\nmessage Customer {\n string id = 1;\n string email = 2;\n}\n"}'

Cluster b

Terminal window
kafka-topics.sh --bootstrap-server b-kafka-1:9092 --create --topic orders.created --partitions 3 --replication-factor 3 --config retention.ms=604800000
kafka-topics.sh --bootstrap-server b-kafka-1:9092 --create --topic payments.settled --replica-assignment 2,2 --config min.insync.replicas=1 --config retention.bytes=10737418240
kafka-topics.sh --bootstrap-server b-kafka-1:9092 --create --topic legacy.events --partitions 3 --replication-factor 3
kafka-acls.sh --bootstrap-server b-kafka-1:9092 --add --allow-principal User:billing --operation Read --topic orders.created
kafka-acls.sh --bootstrap-server b-kafka-1:9092 --add --allow-principal User:stale --operation Read --topic orders.created
kafka-consumer-groups.sh --bootstrap-server b-kafka-1:9092 --group legacy-report --topic orders.created:0 --reset-offsets --to-offset 0 --execute
api=http://registry-b:8080/apis/ccompat/v7; type='Content-Type: application/vnd.schemaregistry.v1+json' # apicurio/apicurio-registry-mem:2.6.5.Final
curl -X POST -H "$type" "$api/subjects/orders.created-value/versions" --data '{"schemaType":"AVRO","schema":"{\"type\":\"record\",\"name\":\"OrderCreated\",\"namespace\":\"com.shop.orders\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"total\",\"type\":\"long\"}]}"}'

Sync

Terminal window
kurkik conn add kafka a --bootstrap a-kafka-1:9092,a-kafka-2:9092,a-kafka-3:9092 --registry-url http://registry-a:8080 --registry-vendor apicurio
kurkik conn add kafka b --bootstrap b-kafka-1:9092,b-kafka-2:9092,b-kafka-3:9092 --registry-url http://registry-b:8080 --registry-vendor apicurio
kurkik kafka export a --acls --groups --stdout > a.yaml # source.yaml
kurkik kafka sync a.yaml b --all --overwrite --revoke --delete --accept-groups --dry-run # plan.txt (and -o json: plan.json)
kurkik kafka sync a.yaml b --all --overwrite --revoke --delete --accept-groups --yes # apply.txt, and the rollback: rollback.yaml
kurkik kafka sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml b --force --yes # revert.txt

All flags: kurkik kafka sync · more Apache Kafka sync examples