Skip to content

microservices-sample/project-initializer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Microservices Sample

What is it?

"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.

Use case

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.

alt tag

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.

alt tag

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).

alt tag

Service Registration

During the initialization of a service, it would get registered to the discovery and registration server (which in our example is Hashicorp's Consul).

alt tag

Service Discovery

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.

alt tag

Architecture

Below is the architectural diagram for microservices sample project.

alt tag

Technology

Microservices sample project uses a number of open source projects to work properly:

Tools

Development

Below are the steps to bring up the development environment and get started.

  1. Install Git, Java, Maven and Docker
  2. Fork all the projects under https://github.com/microservices-sample/
  3. Clone the fork using https://github.com/{YOUR_GIT_ID}/project-initializer.git
  4. Execute "cd /project-initializer/build/docker/scripts/"
  5. Based on your operating system either cd mac or win folder
  6. Execute "./init.sh {YOUR_GIT_ID}" or "init.cmd {YOUR_GIT_ID}" which pulls all the depedent git repositories
  7. To deploy docker please run "./deploy.sh docker" or "deploy.cmd docker".
  8. Access the Application at http://localhost/

Evolution

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

Help

Feel free to reach "[email protected]" incase of any concerns.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages