Coder Social home page Coder Social logo

delbertwoo / spring-eureka Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cse0518/spring-eureka

0.0 0.0 0.0 103 KB

MSA 서버 구조에 Spring Cloud Gateway와 Spring Eureka를 적용해봅니다

Home Page: https://github.com/cse0518/MSA-practice

Java 94.64% Dockerfile 5.36%

spring-eureka's Introduction

Index


MSA 환경 구현

image

Client에서 보낸 요청을 Gateway에서 수신하고, 해당하는 서비스로 라우팅해줍니다.


Spring Cloud Gateway

클라이언트와 백엔드 서비스 사이에서 리버스 프록시 역할을 해줍니다.
그리고 MSA 전체 서비스에 대한 인증, 모니터링 등 관리 포인트를 추가하여 모든 API의 관문 역할을 해줍니다.

Spring Cloud Gateway는 Spring MVC(Tomcat)가 아닌 Netty를 사용하여 구현했습니다.
모든 요청이 Gateway를 통과하기 때문에 빠른 처리가 중요합니다.
Netty는 비동기 WAS이고 1THREAD / MANY REQUESTS 방식이기 때문에 기존 방식보다 더 많은 요청을 처리할 수 있습니다.


Spring Eureka

MSA 기반의 api 서버를 구축하기 위해 spring eureka 기술을 사용했습니다.
Spring Cloud Gateway - Eureka Server, Client를 구현했습니다.

Eureka는 클라우드 환경에서 다수의 서비스들의 로드 밸런싱 및 장애 조치 목적을 가진 미들웨어 서버입니다.
MSA 환경에서 수많은 api 서버들로 구성이 될 것이고, 이 서버들을 하나의 게이트웨이를 통해서 관리합니다.

하나의 Eureka Server에서 여러개의 Eureka Client들을 관리합니다.
Eureka Server는 Eureka Client들을 관리하고,
Eureka Client들은 다른 Client들의 정보를 확인해 통신할 수 있습니다.


Eureka Server

  • discovery server
  • eureka client들을 등록
  • client들로부터 일정 시간마다 heartbeat를 수신,
    heartbeat가 오지 않는 경우 client가 죽었다고 판단,
    일정 시간안에 registry에서 client 정보 삭제
  • 유지된 registry 정보를 client들에게 전달

Eureka Client

  • MSA 환경에서 각각의 서비스들은 eureka client가 된다.
  • 스스로 자신의 meta 정보를 eureka server에 등록
  • 서버로부터 registry 정보를 가져와 캐싱하고 주기적으로 변경사항을 확인한다.
    이를 통해 다른 client들의 정보를 알 수 있음

spring-eureka's People

Contributors

cse0518 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.