0% found this document useful (0 votes)
4 views1 page

Kafka

The document provides commands for managing Kafka topics, producers, and consumers. It details how to create a topic, list existing topics, and set up console producers and consumers using specified commands. Key parameters include bootstrap server, replication factor, partitions, and topic name.

Uploaded by

codandocerto
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Kafka

The document provides commands for managing Kafka topics, producers, and consumers. It details how to create a topic, list existing topics, and set up console producers and consumers using specified commands. Key parameters include bootstrap server, replication factor, partitions, and topic name.

Uploaded by

codandocerto
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

### Create topic

`kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1


--partitions 1 --topic [TOPIC_NAME]`

- -\-bootstrap-server localhost:9092 -> where kafka is running


- -\-replication-factor 1 ->
- -\-partitions 1 ->
- -\-topic [TOPIC_NAME] -> topic name

### List topics

`kafka-topics.sh --list --bootstrap-server localhost:9092`

### Create producer


#### Console producer
`kafka-console-producer.sh --broker-list localhost:9092 --topic [TOPIC_NAME]`
- -\-broker-list localhost:9092 -> consumer server (kafka running)
### Create consumer
#### Console consumer
`kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic [TOPIC_NAME]
--from-beginning`
- -\-from-beginning -> Get messagens from the beginning, if you want only new
messages, do not write this command

You might also like