Skip to content

dtimchenko/custom-microservices-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

custom-microservices-project

Simple microservices POC based on the Spring Cloud and Java 18, to try microservices architecture patterns and technologies.

Project structure:

  • apigw - spring cloud gateway
  • commons - common microservices code
  • config-server - spring cloud config server, for storing services properties in one place
  • consumer - consumer service
  • eureka-server - discovery service, for simple communication between services
  • fraud - service for checking if the consumer is fraudster

Local Setup

Keycloak host

We need to add a host mapping for keycloak. It is crucial because keycloak is relay on the host. If you will run one service from localhost and keycloak from docker - authentication will not work. Because the keycloak host on docker will be: http://keycloak but in browser it will be: http://locahost

Add next items to the hosts

sudo nano /etc/hosts

127.0.0.1 keycloak

Create databases

For customer and fraud service we need to create a databases(it will be automated in future updates). It should be customer and fraud databases.

Run the Project

To run docker containers, just run from the docker: docker compose up

HOWTO

Docker

How to create a docker image

  • add a dockerfile to the project
  • docker build --tag=<repository-name> . - to build an image
  • docker push <repository-name> - push an image to the dockerhub

UPDATE SERVICE PROPERTIES DYNAMICALLY

To update service properties dynamically (without service redeploy) you need:

GENERAL

EUREKA

GRPC And Protobuf

CIRCUIT BREAKER

SPRING WEB

GATEWAY

SPRING SECURITY

OAUTH2

CONFIG SERVER

ZIPKIN TRACING

SPRING CLOUD BUS

ELK CENTRALIZED LOGGING

CENTRALIZED MONITORING

PROPERTIES ENCRYPTION/DECRYPTION

to encrypt a property just send a POST to http://localhost:8010/encrypt (where http://localhost:8010 is the config-server's endpoint)

About

Simple microservices POC

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages