Skip to content

Generate AsyncAPI from an empty Kafka cluster

A brand new cluster: what does the AsyncAPI document look like when there is nothing to describe yet?

Terminal recording of kurkik kafka export

The recording shows kurkik kafka export on the demo sandbox; its data differs from this example.

Shown here: one broker. Other broker setups are further down.

Terminal window
kurkik kafka export prod
asyncapi.yaml
asyncapi: 3.0.0
info:
title: prod Apache Kafka API
version: 1.0.0-SNAPSHOT
description: "Generated by reading the prod cluster. Cluster id: MkU3OEVBNTcwNTJENDM2Qk."
servers:
broker-1:
host: kafka-1:9092
protocol: kafka
protocolVersion: "4.4"
x-kurkik:
kafka:
server:
security:
- security: PLAINTEXT
securityProtocol: PLAINTEXT
brokerConfiguration:
advertised.listeners: "INTERNAL://kafka-1:19092,EXTERNAL://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: kafka-1:9092
security.protocol: PLAINTEXT
groupConfiguration: {}
producerConfiguration: {}
consumerConfiguration: {}
channels: {}
operations: {}

Download asyncapi.yaml

How to build this setup yourself

Brokers

Seed

Export

Terminal window
kurkik conn add kafka prod --bootstrap kafka-1:9092
kurkik kafka export prod
Show the document
asyncapi: 3.0.0
info:
title: prod Apache Kafka API
version: 1.0.0-SNAPSHOT
description: "Generated by reading the prod cluster. Cluster id: MkU3OEVBNTcwNTJENDM2Qk."
servers:
broker-1:
host: kafka-1:9092
protocol: kafka
protocolVersion: "4.4"
x-kurkik:
kafka:
server:
security:
- security: PLAINTEXT
securityProtocol: PLAINTEXT
brokerConfiguration:
advertised.listeners: "INTERNAL://kafka-1:19092,EXTERNAL://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,2@kafka-2:9093,3@kafka-3: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: "3"
process.roles: "broker,controller"
transaction.state.log.min.isr: "1"
transaction.state.log.replication.factor: "3"
clientConfiguration:
bootstrap.servers: "kafka-1:9092,kafka-2:9092,kafka-3:9092"
security.protocol: PLAINTEXT
groupConfiguration: {}
producerConfiguration: {}
consumerConfiguration: {}
broker-2:
host: kafka-2:9092
protocol: kafka
protocolVersion: "4.4"
x-kurkik:
kafka:
server:
security:
- security: PLAINTEXT
securityProtocol: PLAINTEXT
brokerConfiguration:
advertised.listeners: "INTERNAL://kafka-2:19092,EXTERNAL://kafka-2:9092"
authorizer.class.name: org.apache.kafka.metadata.authorizer.StandardAuthorizer
broker.id: "2"
controller.listener.names: CONTROLLER
controller.quorum.voters: "1@kafka-1:9093,2@kafka-2:9093,3@kafka-3: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: "2"
offsets.topic.replication.factor: "3"
process.roles: "broker,controller"
transaction.state.log.min.isr: "1"
transaction.state.log.replication.factor: "3"
clientConfiguration:
bootstrap.servers: "kafka-1:9092,kafka-2:9092,kafka-3:9092"
security.protocol: PLAINTEXT
groupConfiguration: {}
producerConfiguration: {}
consumerConfiguration: {}
broker-3:
host: kafka-3:9092
protocol: kafka
protocolVersion: "4.4"
x-kurkik:
kafka:
server:
security:
- security: PLAINTEXT
securityProtocol: PLAINTEXT
brokerConfiguration:
advertised.listeners: "INTERNAL://kafka-3:19092,EXTERNAL://kafka-3:9092"
authorizer.class.name: org.apache.kafka.metadata.authorizer.StandardAuthorizer
broker.id: "3"
controller.listener.names: CONTROLLER
controller.quorum.voters: "1@kafka-1:9093,2@kafka-2:9093,3@kafka-3: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: "3"
offsets.topic.replication.factor: "3"
process.roles: "broker,controller"
transaction.state.log.min.isr: "1"
transaction.state.log.replication.factor: "3"
clientConfiguration:
bootstrap.servers: "kafka-1:9092,kafka-2:9092,kafka-3:9092"
security.protocol: PLAINTEXT
groupConfiguration: {}
producerConfiguration: {}
consumerConfiguration: {}
channels: {}
operations: {}

Download

How to build this setup yourself

Brokers

Seed

Export

Terminal window
kurkik conn add kafka prod --bootstrap kafka-1:9092,kafka-2:9092,kafka-3:9092
kurkik kafka export prod
Show the document
asyncapi: 3.0.0
info:
title: prod Apache Kafka API
version: 1.0.0-SNAPSHOT
description: "Generated by reading the prod cluster. Cluster id: MkU3OEVBNTcwNTJENDM2Qk."
servers:
broker-1:
host: kafka-1:9092
protocol: kafka
protocolVersion: "4.4"
x-kurkik:
kafka:
server:
security:
- security: PLAINTEXT
securityProtocol: PLAINTEXT
brokerConfiguration:
advertised.listeners: "INTERNAL://kafka-1:19092,EXTERNAL://kafka-1:9092"
authorizer.class.name: org.apache.kafka.metadata.authorizer.StandardAuthorizer
broker.id: "1"
broker.rack: zone-a
controller.listener.names: CONTROLLER
controller.quorum.voters: "1@kafka-1:9093,2@kafka-2:9093,3@kafka-3: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: "3"
process.roles: "broker,controller"
transaction.state.log.min.isr: "1"
transaction.state.log.replication.factor: "3"
clientConfiguration:
bootstrap.servers: "kafka-1:9092,kafka-2:9092,kafka-3:9092"
security.protocol: PLAINTEXT
groupConfiguration: {}
producerConfiguration: {}
consumerConfiguration: {}
broker-2:
host: kafka-2:9092
protocol: kafka
protocolVersion: "4.4"
x-kurkik:
kafka:
server:
security:
- security: PLAINTEXT
securityProtocol: PLAINTEXT
brokerConfiguration:
advertised.listeners: "INTERNAL://kafka-2:19092,EXTERNAL://kafka-2:9092"
authorizer.class.name: org.apache.kafka.metadata.authorizer.StandardAuthorizer
broker.id: "2"
broker.rack: zone-b
controller.listener.names: CONTROLLER
controller.quorum.voters: "1@kafka-1:9093,2@kafka-2:9093,3@kafka-3: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"
log.cleaner.threads: "2"
min.insync.replicas: "1"
node.id: "2"
num.network.threads: "5"
offsets.topic.replication.factor: "3"
process.roles: "broker,controller"
transaction.state.log.min.isr: "1"
transaction.state.log.replication.factor: "3"
clientConfiguration:
bootstrap.servers: "kafka-1:9092,kafka-2:9092,kafka-3:9092"
security.protocol: PLAINTEXT
groupConfiguration: {}
producerConfiguration: {}
consumerConfiguration: {}
broker-3:
host: kafka-3:9092
protocol: kafka
protocolVersion: "4.4"
x-kurkik:
kafka:
server:
security:
- security: PLAINTEXT
securityProtocol: PLAINTEXT
brokerConfiguration:
advertised.listeners: "INTERNAL://kafka-3:19092,EXTERNAL://kafka-3:9092"
authorizer.class.name: org.apache.kafka.metadata.authorizer.StandardAuthorizer
broker.id: "3"
broker.rack: zone-c
controller.listener.names: CONTROLLER
controller.quorum.voters: "1@kafka-1:9093,2@kafka-2:9093,3@kafka-3: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"
log.retention.hours: "72"
min.insync.replicas: "1"
node.id: "3"
offsets.topic.replication.factor: "3"
process.roles: "broker,controller"
transaction.state.log.min.isr: "1"
transaction.state.log.replication.factor: "3"
clientConfiguration:
bootstrap.servers: "kafka-1:9092,kafka-2:9092,kafka-3:9092"
security.protocol: PLAINTEXT
groupConfiguration: {}
producerConfiguration: {}
consumerConfiguration: {}
channels: {}
operations: {}

Download

How to build this setup yourself

Brokers

Terminal window
kafka-configs.sh --bootstrap-server kafka-1:9092 --entity-type brokers --entity-name 2 --alter --add-config log.cleaner.threads=2

Seed

Export

Terminal window
kurkik conn add kafka prod --bootstrap kafka-1:9092,kafka-2:9092,kafka-3:9092
kurkik kafka export prod

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