Simple kafka message server construction
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