This app demonstrates a few concepts..
- Rapid prototyping with Docker
- Kafka
- A simple producer (message-api)
- A simple consumer (consumer) that does something with the messages (stores them in redis)
- A simple www-api that reads from redis and returns this data via JSON
- A simple web page (using harp to serve the static assets) which uses jquery to display a list of messages from the www-api
- Running of Integration tests
This is not meant to ever leave a developers laptop...
Checkout this repo and just run docker-compose up -d
.
Fire off an event with something like....
curl -X POST -H "Content-Type: application/json" -d '{"message":"This is a test message!"}' http://192.168.99.100:8081/message/news
Tail the logs of the consumer process
curl 192.168.99.100:8080/messages/list
open http://192.168.99.100:9000
- First start all services via
docker-compose up -d
- Give the system a minute or so to converge and such. Kafka needs to start up and register itself with zookeeper.
- Run the integration tests with the following command
docker-compose run tests lettuce