Created
December 24, 2019 03:38
-
-
Save ryanhs/c4dffc1941e88a77dfee3ef0cad4fb17 to your computer and use it in GitHub Desktop.
kafkajs create topic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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