Kafka

Install

wget http://apache.claz.org/kafka/1.0.0/kafka_2.11-1.0.0.tgz
tar -xzf kafka_2.11-1.0.0.tgz
cd kafka_2.11-1.0.0

start server

bin/zookeeper-server-start.sh config/zookeeper.properties
bin/kafka-server-start.sh config/server.properties

create a topic

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

send messages

$ bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test
This is a message
This is another message

start a consumer

$ bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning
This is a message
This is another message

ref: https://kafka.apache.org/quickstart

results matching ""

    No results matching ""