Giter VIP home page Giter VIP logo

messaging-microservices-demo's Introduction

Messaging Microservices Demo

Demonstrates how to create Java/Spring based microservices using modern approaches:

  • Service Discovery (HashiCorp Consul)
  • API Gateway (Spring Cloud Gateway)
  • Client-side load-balancing (Spring Cloud LoadBalancer)
  • OpenID Connect based user authentication (Spring Security/Keycloak)
  • Distributed sessions (Spring Session/Redis)
  • OAuth 2.0 scope based service-to-service authorization (Spring Security/Keycloak)
  • Data caching (Spring Cache/Redis)
  • Cloud Bus to broadcast cache invalidation notifications between microservices (Spring Cloud Bus/Apache Kafka)
  • Database schema evolution (Liquibase)
  • Java classes mapping (MapStruct)
  • Distributed tracing (Spring Sleuth/Zipkin)
  • Containerized microservices (Docker)
  • Infrastructure as Code (HashiCorp Terraform)

Prerequisites

  • JDK 11
  • Maven
  • Docker
  • Docker Compose
  • Terraform

Infrastructure provisioning

  • Run under infrastructure directory
docker-compose up -d
  • Run under infrastructure/terraform directory
source ./env.sh
  • Run under infrastructure/terraform/0100-database directory
terraform init
terraform apply
  • Run under infrastructure/terraform/0200-oidc directory
terraform init
terraform apply
  • Run under infrastructure/terraform/0300-consul directory
terraform init
terraform apply

You can access some infrastructure services using the following addresses:

Service Address Credentials
Consul http://localhost:8500
Keycloak http://localhost:8180 admin/secret
Kafdrop http://localhost:9000
Zipkin http://localhost:9411

How to run

Without containers

  • Build and run microservices in api-gateway, messages-service and profiles-service directories
mvn -DskipTests spring-boot:run

Inside containers

  • Build docker containers for microservices in api-gateway, messages-service and profiles-service directories
mvn -DskipTests clean package docker:build
  • Start microservices containers
docker-compose up -d

How to use

Open in a browser the following URLs to see the inbox and outbox messages:

http://localhost:8080/api/messages/message/inbox
http://localhost:8080/api/messages/message/outbox

You will be redirected to the login page. Use one of the following users - victor.fisyuk, john.doe (use secret as password).

By default, there are no messages. You could send new messages using Postman collection postman_collection.json. You could also update user profiles using Postman.

messaging-microservices-demo's People

Contributors

victor-fisyuk avatar

Watchers

 avatar

Forkers

yardcooper

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.