-
Run Docker Compose file:
docker-compose up -d
-
Your IP:
- mac:
ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'
- linux:
hostname -i | awk '{print $1}'
- mac:
-
List Topics:
docker exec -it my_scala_kafka bash
/opt/kafka/bin/kafka-topics.sh --list --zookeeper {IP}:2181
-
Create Consumer:
docker exec -it my_scala_kafka bash
/opt/kafka/bin/kafka-console-consumer.sh -bootstrap-server {IP}:9092 --topic fs2.topic --from-beginning
-
Run Consumer App:
ConsumerKafka
: Fs2 Consumer Kafka.
-
Run Publisher App:
PublisherKafka
: Fs2 Publisher Kafka.
-
Dowload Apache Kafka.
-
Run Apache Zookeeper:
./{KAFKA_PATH}/bin/zookeeper-server-start.sh ./config/zookeeper.properties
-
Run Apache Kafka:
./{KAFKA_PATH}/bin/kafka-server-start.sh ./config/server.properties
-
Create
fs2.topic
:- With a Single partions:
./{KAFKA_PATH}/bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic fs2.topic
- With multiple partitions:
./{KAFKA_PATH}/bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 3 --topic fs2.topic
- With a Single partions:
-
List Topics:
./{KAFKA_PATH}/bin/kafka-topics.sh --list --zookeeper localhost:2181
-
Create Consumer:
./{KAFKA_PATH}/bin/kafka-console-consumer.sh -bootstrap-server localhost:9092 --topic fs2.topic --from-beginning
-
Run Consumer App:
ConsumerKafka
: Fs2 Consumer Kafka.
-
Run Publisher App:
PublisherKafka
: Fs2 Publisher Kafka.