├── README.adoc ├── runKafka.sh ├── runRabbitWMgmt.sh ├── startMessagingPlatforms.sh └── stopMessagingPlatforms.sh /README.adoc: -------------------------------------------------------------------------------- 1 | = Basic infrastructure config to create/run enterprise messaging platforms locally 2 | 3 | == Maintainer 4 | 5 | * Mark Heckler 6 | * mailto:mark@thehecklers.org[mark@thehecklers.org] 7 | * https://twitter.com/mkheck[@mkheck on Twitter] 8 | 9 | == Purpose 10 | 11 | These are some scripts I use to create, configure, & run RabbitMQ & Apache Kafka on my local machine for live-coding sessions. 12 | 13 | NOTE: This should be obvious, but these scripts/configurations are *not* intended to be "enterprise grade" and used for production loads! Use them at your own risk. They work great for development and demos, though. 14 | 15 | I typically use some or all of these to spin up/down Docker containers in support of my sessions titled *"Drinking from the Stream: How to use messaging platforms for scalability & performance"* and *"Building Reactive Pipelines: How to go from scalable apps to (ridiculously) scalable systems"*. For related code repos (with links to related slides), please see links at the bottom of this README. 16 | 17 | Here is the general order of things to set it up like I use it: 18 | 19 | . Install Docker on your machine 20 | . `git clone` this repo (or fork, then clone, etc.) 21 | . Start Docker 22 | . Create the various images & start the associated containers (this must only be done once) 23 | .. Run the `runRabbitWMgmt.sh` script to create local Rabbit image & run the container 24 | .. Run the `runKafka.sh` script to create local Zookeeper & Kafka images & run one container of each 25 | . Run the `stopMessagingPlatforms.sh` script to shut it all down 26 | . For subsequent startup/shutdown of these containers, simply run `startMessagingPlatforms.sh` & `stopMessagingPlatforms.sh` to start/stop 27 | 28 | The start/stop scripts are simply convenience scripts that do a `docker start` / `docker stop` of existing local containers. 29 | 30 | NOTE: I use the RabbitMQ image that includes the RabbitMQ management console. This is really useful for monitoring & managing your Rabbit config (exchanges, queues, pushing test messages into, extracting from, purging, etc.). 31 | 32 | And of course, you can watch this repo to be notified of updates. Thanks! 33 | 34 | == Related repositories 35 | 36 | * https://github.com/mkheck/drinking-from-the-stream["Drinking from the Stream: How to use messaging platforms for scalability & performance" repo] 37 | * https://github.com/mkheck/building-reactive-pipelines["Building Reactive Pipelines: How to go from scalable apps to (ridiculously) scalable systems" repo] 38 | -------------------------------------------------------------------------------- /runKafka.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | docker network create kafka 4 | 5 | docker run -d --net=kafka --name=zookeeper -e ZOOKEEPER_CLIENT_PORT=2181 confluentinc/cp-zookeeper:5.0.0 6 | docker run -d --net=kafka --name=kafka -p 9092:9092 -e KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092 -e KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 confluentinc/cp-kafka:5.0.0 7 | 8 | docker ps 9 | 10 | echo "" 11 | echo "" 12 | echo "If you can't connect, add this line to /etc/hosts:" 13 | echo "" 14 | echo "127.0.0.1 kafka" 15 | echo "" 16 | echo "to ensure proper routing to container network 'kafka'." 17 | echo "" 18 | -------------------------------------------------------------------------------- /runRabbitWMgmt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | docker run -d --name myrabbitwmgmt -p 4369:4369 -p 5671:5671 -p 5672:5672 -p 25672:25672 -p 15671:15671 -p 15672:15672 rabbitmq:management 4 | 5 | docker ps 6 | -------------------------------------------------------------------------------- /startMessagingPlatforms.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | clear 3 | echo ===== START MESSAGING PLATFORMS ===== 4 | echo 5 | docker start myrabbitwmgmt 6 | docker start zookeeper 7 | docker start kafka 8 | echo 9 | docker ps 10 | -------------------------------------------------------------------------------- /stopMessagingPlatforms.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | clear 3 | echo ===== STOP MESSAGING PLATFORMS ===== 4 | echo 5 | docker stop myrabbitwmgmt 6 | docker stop kafka 7 | docker stop zookeeper 8 | echo 9 | docker ps 10 | --------------------------------------------------------------------------------