GithubHelp home page GithubHelp logo

choiis / spring-kotlin-msa Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 204 KB

Spring Kotlin MSA api gateway & service discovery with consul & Jaeger & MySQL JPA & Cassandra

Dockerfile 2.25% Kotlin 97.75%
cassandra consul docker-compose kotlin maven mysql spring-boot api-gateway config-server feign-client

spring-kotlin-msa's Introduction

Spring-Cloud-MSA

  • Spring MSA api gateway & service discovery with consul & Jaeger & MySQL JPA & Cassandra

Prepare project environment

  • Prepare the Cassandra server
  • Create a keyspace and table with table.sql file
  • As of version 1.11.1 of Consul
  • Download version 1.11.1 according to your operating system from https://www.consul.io/downloads
  • After unzip Consul, run it as Server
./consul agent -server -bootstrap -ui -client=0.0.0.0 -data-dir ./data --bind=127.0.0.1 &
  • Check at http://localhost:8500

  • After installing docker compose, run docker-compose.yml in this jaeger_all_in_one or jaeger_msa directory

  • Execute Jaeger Tracing with docker

docker-compose up
  • Check at http://localhost:16686

  • Execute docker-compose.yml in mysql folder to run mysql server and create table

docker-compose up

Execution

Build all

  • mvn clean install

Gateway Execution

  • mvn -pl gateway spring-boot:run

Config Server Execution

  • mvn -pl config-server spring-boot:run -Dspring-boot.run.jvmArguments="-Dspring.profiles.active=dev1"

Service Execution

  • mvn -pl appkey-service spring-boot:run -Dspring-boot.run.jvmArguments="-Dspring.profiles.active=dev1"

  • mvn -pl appkey-service spring-boot:run -Dspring-boot.run.jvmArguments="-Dspring.profiles.active=dev2"

  • mvn -pl api-service spring-boot:run -Dspring-boot.run.jvmArguments="-Dspring.profiles.active=dev1"

  • mvn -pl api-service spring-boot:run -Dspring-boot.run.jvmArguments="-Dspring.profiles.active=dev2"

api service swagger

Run all with docker-compose

Build all

  • mvn -pl gateway clean package spring-boot:repackage docker:build
  • mvn -pl config-server clean package spring-boot:repackage docker:build
  • mvn -pl appkey-service clean package spring-boot:repackage docker:build
  • mvn -pl api-service clean package spring-boot:repackage docker:build

docker-compose

  • docker-compose up

check Jaeger trace

  • You can search traces between MSA services at http://localhost:16686 Jaeger1

  • You can see the structure of calls between MSA services Jaeger2

check logs

  • You can view the docker container logs under the logs directory by connecting to the docker volume.

spring-kotlin-msa's People

Contributors

choiis avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.