Skip to content

Instantly share code, notes, and snippets.

@ryanhs
Created December 24, 2019 03:38
Show Gist options
  • Save ryanhs/c4dffc1941e88a77dfee3ef0cad4fb17 to your computer and use it in GitHub Desktop.
Save ryanhs/c4dffc1941e88a77dfee3ef0cad4fb17 to your computer and use it in GitHub Desktop.
kafkajs create topic
const { Kafka } = require('kafkajs')
const kafka = new Kafka({
clientId: 'topic-creator',
brokers: ['b-1.cu94'],
ssl: true,
})
const admin = kafka.admin()
const createTopic = topic => admin.createTopics({ topics: [{ topic }] })
// createTopic('astraku-uat-logs').then(console.log)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment