Skip to content

Latest commit

 

History

History
74 lines (52 loc) · 1.57 KB

File metadata and controls

74 lines (52 loc) · 1.57 KB

Kafka Cluster & Control Center

Basic structure and examples to start with kafka to your projects.

All Services

Zookeeper(cluster), Kafka(cluster), Control Center and Kafka Topics Generator

All Services

Others

Create Topic by command line

Access container:

docker exec -ti kafka-1 bash

Run command to create:

kafka-topics --create --bootstrap-server kafka-2:29092 --replication-factor 3 --partitions 3 --topic mytopic

Run command to list:

kafka-topics --list --bootstrap-server kafka-2:29092

Run command to show topic details:

kafka-topics --describe --bootstrap-server kafka-2:29092 --topic mytopic

Topic details


Test Producer by command line

Connect to topic:

kafka-console-producer --broker-list kafka-2:29092 --topic mytopic

Producer Sending


Test Consumer by command line

Connect to topic:

kafka-console-consumer --bootstrap-server kafka-2:29092 --topic mytopic

Consumer Receiving

Connect to topic with Consumer Group:

kafka-console-consumer --bootstrap-server kafka-2:29092 --topic mytopic --from-beginning --group a

Show Consumer Group details:

kafka-consumer-groups --group a --bootstrap-server kafka-2:29092 --describe

Consumer Group details


Kafka Topics Generator

Will create topics on startup by using kafka console. kafka-topics.

References:

https://kafka.js.org/docs/getting-started