Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Simple kafka message server construction

Shulou Source: shulou.com Published: 2022-06-03 06:16:31 09月24日 Update

Distributed message server kafka

# # Building process:

Steps:

1: download the code and extract it

2: start the zookeeper server: bin/zookeeper-server-start.sh config/zookeeper.properties

3: start the kafka server: bin/kafka-server-start.sh config/server.properties

4: create a topic:bin/kafka-topics.sh-create-zookeeper localhost:2181-replication-factor 1-partitions 1-topic mytopic

Check whether the creation is successful: bin/kafka-topics.sh-- list-- zookeeper localhost:2181

5: send a message: bin/kafka-console-producer.sh-- broker-list localhost:9092-- topic mytopic

6: start a consumer: bin/kafka-console-consumer.sh-bootstrap-server localhost:9092-topic mytopic-from-begining

Tags: Server service message success code distributed step consumer process consumption simplicity Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Redmi MySQL Shulou Information MariaDB