"Microservices", a trending buzz word nowadays. What problems does it solve?
Many organizations nowadays are driving the technology migrations and one of the biggest challenges is to migrate from monolithic application to micro-services based application.
This mircoservices-sample project demonstrates how multiple services run independently leveraging on the best microservices patterns to enable scale, performance and resilience.
The sample application has two services namely service-one and service-two. Each of the service has its own database service-one-db and service-two-db respectively. During the startup of the services, it persists the service name and an auto generated UUID in its perspective database and sends the data to the RabbitMQ exchange which then broadcasts the data to all the queues based on the routing key. Every microservices listens to its own RabbitMQ queue and keeps updating the database as and when it receives the data.
Below are the screens of the application.
Clicking on the tab's one or two the data that you see on the screen is based on the data fetched by the respective service by calling its database.
Notice that the UUID generated for service-one which lies in service-one-db is in sync with service-two tab which is achieved by RabbitMQ (asychronous communication between microservices).
During the initialization of a service, it would get registered to the discovery and registration server (which in our example is Hashicorp's Consul).
When one service (say api-gateway) needs to access a resource from another service (say service-one), all it has to do is ask discovery and registration server (Consul) to give one of the service-one's instance information.
Below is the architectural diagram for microservices sample project.
Microservices sample project uses a number of open source projects to work properly:
- SpringBoot - Application framework
- Zuul - API Gateway (Load Balancer)
- Consul - Service registration and Discovery
- Docker - Containerization platform
- RabbitMQ - asynchronous microservices messaging.
- Logstash - Log collector
- Elasticsearch - Log indexer
- Kibana - Data visualization
- Angular - HTML enhanced for web apps!
- Bootstrap - great UI boilerplate for modern web apps
- jQuery - HTML document traversal and manipulation
- Swagger - API documentation
Below are the steps to bring up the development environment and get started.
- Install Git, Java, Maven and Docker
- Fork all the projects under https://github.com/microservices-sample/
- Clone the fork using https://github.com/{YOUR_GIT_ID}/project-initializer.git
- Execute "cd /project-initializer/build/docker/scripts/"
- Based on your operating system either cd mac or win folder
- Execute "./init.sh {YOUR_GIT_ID}" or "init.cmd {YOUR_GIT_ID}" which pulls all the depedent git repositories
- To deploy docker please run "./deploy.sh docker" or "deploy.cmd docker".
- Access the Application at http://localhost/
To go through the complete evolution of this micro-services sample application refer branches version-1 till version-4 at https://github.com/vmudigal/microservices-sample
Feel free to reach "[email protected]" incase of any concerns.



.png?raw=true)
.png?raw=true)
