Building a Client-Server Application using Docker/RabbitMQ and Java/Spring Boot - Part 1

Feb 18,2018 at 03:40 pm By Ben Hutton

The aim of this project is create Services that runs system level utilities, an API gateway that talks to this with RabbitMQ in the middle.  The main reason behind RabbitMQ is the eventual aim of this is to manage virtual machines.  That is creating and running them is not a instantaneous process to RabbitMQ will allow decoupling of the API from the service back-end.  I currently have a python/flask version of this however it isn't using a messaging bus and has gotten to the point of needing one.  Since my work has more of a call for Java/Spring and JavaScript/React skills I thought I would rewrite the middleware API in Java/Spring and the front-end in JavaScript/React

RabbitMQ via Docker 

First step it to get RabbitMQ running.  Since my laptop already has Docker on it and I want to learn it better I thought I would start with that. This was pretty straight forward, just run the following command.

docker run -d --hostname vpsmanager-rabbitmq --name vpsmanager-rabbitmq -p 15672:15672 -p 5672:5672 rabbitmq:3-management

Note:  The web gui is on 15672 and applications will talk to it on 5672.

Once up and running point your browser at:

localhost:15672

You should now see the RabbitMQ login page.  Using guest/guest to login.  Now to manage the docker container you can use the following:

Start container

docker start vpsmanager-rabbitmq

Stop Container

docker stop vpsmanager-rabbitmq

Spring-Boot & RabbitMQ

Now to build a spring-boot app that connects to RabbitMQ.  Using one of the starters from the spring-boot official site seems a no brainer to me.  I will outline this in the next post...

 

Leave a comment

Login to Comment

Copyright © 2017 | Ben Hutton