Created
March 19, 2017 09:26
-
-
Save ScalaWilliam/6fb8892c114e289e17593af7db6a3290 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Steps to verify our Kafka Mirror App works: | |
| # Start Kafka | |
| docker run -p 2181:2181 -p 9092:9092 \ | |
| --name kafka --rm \ | |
| --env ADVERTISED_HOST=172.17.0.2 \ | |
| --env ADVERTISED_PORT=9092 \ | |
| spotify/kafka | |
| # Start producer | |
| (while [ true ]; do date ; done) | docker exec -i kafka /opt/kafka_2.11-0.10.1.0/bin/kafka-console-producer.sh --broker-list 172.17.0.2:9092 --topic in | |
| # Start consumer | |
| docker exec -i kafka /opt/kafka_2.11-0.10.1.0/bin/kafka-console-consumer.sh --bootstrap-server 172.17.0.2:9092 --topic out --from-beginning | |
| # Mirror producer topic into consumer topic | |
| export JAVA_OPTS=" \ | |
| -Dinput-topic=in \ | |
| -Doutput-topic=out \ | |
| -Dakka.kafka.consumer.kafka-clients.group.id=akka \ | |
| -Dakka.kafka.consumer.kafka-clients.bootstrap.servers=kafka:9092 \ | |
| -Dakka.kafka.producer.kafka-clients.bootstrap.servers=kafka:9092" | |
| docker run --link=kafka -e JAVA_OPTS -i scalawilliam/kafka-mirror |
Client:
$ brew install mosquitto
$ /usr/local/Cellar/mosquitto/1.4.11_2/bin/mosquitto_sub -d -t 'topic/+/pattern'
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For local: