Skip to content

golgotha/downtime-microservices

Repository files navigation

microservices application example

The experimental project which shows a simple microservice architecture with Spring Cloud and Docker.

To run the application you necessary to install docker.

The application emulates very simple event generation and finalization workflow. After an event will be finished API sends request to Ticket service in order to finalize tickets related to this event.

Scheduler service - generates events and persist them in MySQL database.

Ticket service allows to book and finalize tickets and persists data in MongoDB

Build application

mvn clean install

It will build all docker images that are required to run the application.

Run in docker

docker-compose up -d

Application UI starts on http://localhost:3000

API Gateway service

API Gateway service is located on http://localhost:9000 The main aim the API gateway is to route request to appropriate services.

In the UI user can switch between two versions of API.

v1 - static service. It means when a user clicks on "Book ticket" button "ticketId" in response always will be 10. This service is a mock and never store ticket in MongoDB

v2 - dynamic service. It means "ticketId" will be generated based on timestamp.

Main components

  1. API Gateway - takes all the requests from clients and determines which service needed
  2. Service Discovery: Eureka server. http://localhost:8761
  3. Feign Client is a declarative web service client to communicate between services

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published