Posts

Showing posts from August, 2016

Docker - Multi Container App

Image
In my last post I used Docker to build and run a simple Spring Boot application. This post will take things a little further by introducing a second container, showing you how distinct components can be deployed in separate containers and how those containers can communicate.

We'll build a simple Spring Boot app with a REST endpoint that takes an incoming message and adds it to an ActiveMQ message queue. A second endpoint will use a receiver component to consume the next message from the queue and return it to the client.  The application itself is simple but it'll provide a pretty realistic use case for how you might use multiple Docker containers during development.
Application Components I'm not going to cover the application code in a huge amount of detail but I'll describe the fundamentals components and how they fit together. The MessageController below exposes 2 endpoints, one for posting a message and one for retrieving a message.  I've injected a MessageSen…