diff --git a/kafka/README.md b/kafka/README.md index 7503390..98339d8 100644 --- a/kafka/README.md +++ b/kafka/README.md @@ -1,2 +1,24 @@ kafka ===== + +## How It Works + +![](https://github.com/wurstmeister/kafka-docker/wiki/kafka-communication.png) + +[read more](https://github.com/wurstmeister/kafka-docker/wiki/Connectivity) + +## Up and Running + +```bash +# Broker +$ docker-compose up -d +$ docker-compose exec kafka bash +>>> kafka-topics.sh --create --zookeeper zookeeper:2181 --replication-factor 1 --partitions 2 --topic my-topic +>>> exit + +# Producer +$ kafkacat -P -b localhost:9092 -t my-topic + +# Consumer +$ kafkacat -C -b localhost:9092 -t my-topic -o end +``` diff --git a/kafka/docker-compose.yml b/kafka/docker-compose.yml index 24c59dc..07ae074 100644 --- a/kafka/docker-compose.yml +++ b/kafka/docker-compose.yml @@ -11,12 +11,12 @@ kafka: image: wurstmeister/kafka ports: - "9092:9092" - links: - - zookeeper volumes: - - ./kafka:/kafka + - ./data/kafka:/kafka - /var/run/docker.sock:/var/run/docker.sock environment: - KAFKA_ADVERTISED_HOST_NAME=10.50.254.182 - KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 + links: + - zookeeper restart: always