Awesome Open Source
Awesome Open Source

SPRING BOOT MICROCSERVICE USING SPRING CLOUD, EUREKA, RIBBON, ZUUL, ZIPKIN, SLEUTH

This project is created to get experience on Microservices With Netflix OSS. This is a simple project by coded imperative programming with simple business requirements.

ELK Stack has been integrated for monitoring since version 1.1.0.

There are four microservices:

  • Accounts : This microservice is responsible for managing accounts. An account could be buyer, seller or an backoffice account but there is only buyer account.
  • Products : This microservice is responsible for managing products.
  • Orders : This microservice is responsible for managing orders. It doesn't know anything about account and product except id.
  • Backoffice: This microservice is provides endpoints for backoffice ui.

Backoffice microservice has an endpoint with path "/api/v1/backoffice/orders". This endpoint return a list of orders with name of product and account. It connects accounts, products and orders microservices via Feign.

EndPoints

Service EndPoint Method Description
Accounts /api/v1/accounts/{id} GET Return detail of specified account
Accounts /api/v1/accounts GET Return details of all acounts
Products /api/v1/products/{id} GET Return detail of specified product
Products /api/v1/products GET Return details of all products
Orders /api/v1/orders/{id} GET Return detail of order
Orders /api/v1/orders GET Return details of orders
Backoffice /api/v1/backoffice/orders GET Return orders with product name and account name

Gateways

Service EndPoint
Accounts /account/api/v1/accounts/{id}
Accounts /account/api/v1/accounts
Products /product/api/v1/products/{id}
Products /product/api/v1/products
Orders /order/api/v1/orders/{id}
Orders /order/api/v1/orders
Backoffice /backoffice/api/v1/backoffice/orders

URI for gateway : http://localhost:8762

Used Netflix OSS:

  • Netflix Eureka is used for discovery service.
  • Netflix Ribbon is used for client side load-balancing.
  • Netflix Zuul is used for gateway.

Distributed Tracing:

  • Sleuth and Zipkin

You can open Zipkin : http://localhost:9411 Zipkin Filter Zipkin Full Trace

Used ELK STACK:

  • ElasticSearch is on 6972 port
  • Logstash TCP is on 5000 port
  • Kibana is on 5601 port

Open kibana with http://localhost:5601/. You must define an index pattern (taner-*) on Management/Stack Management.

Kibana

Build & Run

  • >mvn clean package : to build
  • >docker-compose up --build : build docker images and containers and run containers
  • >docker-compose stop : stop the dockerized services
  • Each maven module has a Dockerfile.

In docker-compose.yml file:

  • Accounts Service : 2222 port is mapped to 7500 port of host
  • Products Service : 2222 port is mapped to 7501 port of host
  • Orders Service : 2222 port is mapped to 7502 port of host
  • Backoffice Service : 2222 port is mapped to 7503 port of host
  • Eureka Discovery Service : 8761 port is mapped to 8761 port of host
  • Zuul Gateway Service : 8762 port is mapped to 8762 port of host

VERSIONS

1.2.0

  • Sleuth and Zipkin Integration
  • Making some refactorings
  • Lombok Integration

1.1.0

  • ElasticSearch, Kibana, Logstash integration

1.0.0 SNAPSHOT

  • Spring-Boot 2.3.1.RELEASE
  • Java 11
  • Docker Image updated
  • Spring-Cloud artifacts have been changed
  • Open Feign integrated

0.0.1

  • Spring-Boot 2.0.2.RELEASE
  • Java 8

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
java (30,349
docker (2,726
spring-boot (725
elasticsearch (530
docker-compose (368
microservice (357
kibana (89
distributed-tracing (72
logstash (71
elk (59
eureka (53
zuul (44
feign (28
logback (27

Find Open Source By Browsing 7,000 Topics Across 59 Categories