Code Monkey home page Code Monkey logo

spring-boot-microservices's Introduction

BOOTiful Microservices

Spring-boot based Microservice platform with

CI and CD

  • Jenkins CICD pipeline is included in every service that will build and deploy the service
  • Ability to switch build profile at build time using Maven profiles for either
    • Container platform
    • AWS Lambda

Pre-requisite

  • JDK 11 compiler
  • Maven > 3.5.0
  • Docker > 1.18 (Docker desktop on Windows and MacOS will work)
  • Docker compose (latest version. Comes with Docker desktop)
  • Kubernetes is turned on in Docker Desktop

Understanding components in this project

Spring boot pom parent (anair-pom-parent)

  • Parent pom that manages commonly used dependencies and plugins.
  • All services in this project will extend from this parent pom.
  • Read more...

Spring boot Rest Maven archetype (anair-rest-archetype)

  • Template project that can be used to generate a Restful spring boot application with sample java classes, properties
  • Read more...

Spring boot services

  • Admin console
    • Spring boot services admin console
  • Rest Service
    • Exposes a rest endpoint
    • Publishes a message on a Kafka topic
    • Invoke a GET grpc endpoint
  • Kafka client
    • Consumes message from the Kafka topic published by Service A
  • Protobuf Service
    • Expose grpc endpoint producing protobuffer content when invoked by Service A
  • Lambda Function
    • AWS lambda Fn invoked using SQS and/or CloudWatch event. Creates a S3 file and sends a message to an outbound SQS queue

Helm project for anair-service-rest

  • Helm scripts to deploy service-rest to k8s cluster. Read more

Logging

Publish application and system logs to a centralized server.

  • Logs from applications and systems are collected by Fluentd
    • Review fluentd conf at logging/fluentd/conf/fluent.conf that has elasticsearch and loki outputs
  • Fluentd publishes the logs to OpenDistro Elasticsearch server and Loki
  • Visualize logs in Kibana
  • Visualize logs in Grafana using Loki datasource

Metrics

Infrastructure services

The spring boot microservices integrates with the following infrastructure components:

Middleware services

The spring boot microservices integrates with the following middleware components:

Running microservices

In a Docker environment

  1. Navigate to this project
  2. Review docker-compose.yml and docker-compose-infra.yml files
  3. Run mvn clean package on anair-service-rest, anair-service-kafka, anair-service-proto, anair-service-admin. This has to be done anytime code is changed and has to be deployed in docker.
  4. Run docker-compose -f docker-compose-infra.yml up to start infrastructure services:
    • Jaeger
    • Elasticsearch
    • Kibana
    • Prometheus
    • Prometheus node exporter
    • cAdvisor
    • Loki
    • Grafana
    • Localstack (AWS stack)
  5. Run docker-compose -f docker-compose-middleware.yml up to start middleware services:
    • Fluentd
    • Zookeeper
    • Kafka
  6. Run docker-compose up to start microservices:
    • Spring boot admin
    • Rest Service
    • Kafka Service
    • Protobuf Service
  7. Verify that the below mentioned URls are accessible

Spring boot admin wallboard

Urls

Executing service endpoints

  • In Service A swagger page, try out /publish/{userId} endpoint. This will execute a kafka and grpc transaction. Check logs of all 3 services. View the trace graph in Jaeger UI.

spring-boot-microservices's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.