문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 다음 판 양쪽 다음 판 | ||
java:zuul [2019/02/28 20:09] kwon37xi |
java:zuul [2021/11/09 11:24] kwon37xi [Netflix의 Client Serving Server] |
||
---|---|---|---|
줄 1: | 줄 1: | ||
- | ====== Zuul - Edge Service====== | + | ====== Zuul - API Gateway |
- | * [[https:// | + | * [[https:// |
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[: | ||
* [[https:// | * [[https:// | ||
* [[http:// | * [[http:// | ||
- | ===== Edge Service | + | ===== Netflix의 Client Serving Server |
- | * Edge Service | + | * Web Browser 혹은 App 등이 접속하는 서버를 |
- | * 여기서 권한 문제가 | + | * Client Server Adapter Code Server 를 두고 거기서 Client |
- | * 뒷단 | + | * API Gateway 는 이 때 Client Server Adapter 보다 더 앞에서 Client 의 요청을 받아서 처리한다. |
+ | * Netflix 는 Client 의 종류가 TV, PC, Android, iOS 등 너무 다양해서 API Gateway 를 통해서 요청을 받지만 현재 일반적인 서비스는 그런식으로 만드는 경우가 | ||
+ | * 꼭 API Gateway 가 필요하다면 무조근 API Gateway 에 접속하는 사용자와 | ||
+ | * Client Adapter Code 에서는 ''/ | ||
+ | * FAQ : 인증/권한이 문제라면, backend API가 권한을 처리하면 되는거 아닌가? | ||
+ | * 아니다, backend API는 자기 본분에 충실해야 한다. | ||
+ | * 또한, 인증 체계는 하나의 시스템에 2~3개씩 존재할 수 있다.(일반 사용자, admin, 제 3의 상품 제공업체 등) | ||
+ | * 이 모든 인증 체계에 대해 모든 backend API가 인증/권한을 관리하는 것은 회사 전체의 개발 속도를 떨어뜨린다. | ||
+ | * 또한 신규 인증 체계 추가시에도 모든 backend API가 이에 대한 처리를 추가해야 한다. | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
[[https:// | [[https:// | ||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
===== Spring Cloud Neflix Zuul ===== | ===== Spring Cloud Neflix Zuul ===== | ||
+ | * [[https:// | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
줄 17: | 줄 34: | ||
* [[http:// | * [[http:// | ||
* [[https:// | * [[https:// | ||
+ | |||
+ | ==== 다중 path 지정 ==== | ||
+ | * [[https:// | ||
+ | * '' | ||
+ | <code yml> | ||
+ | zuul: | ||
+ | routes: | ||
+ | myserver_mypath: | ||
+ | path: /mypath/** | ||
+ | url: .... | ||
+ | serviceId: myserver | ||
+ | myserver_another_path: | ||
+ | path: / | ||
+ | url: ... | ||
+ | serviceId: myserver | ||
+ | </ | ||
+ | ==== actuator ==== | ||
+ | * ''/ | ||
+ | * boot 2.1 의 경우 '' | ||
+ | |||
+ | ==== Filter ==== | ||
+ | === Service ID 알아내기 === | ||
+ | * ' | ||
+ | <code java> | ||
+ | @Override | ||
+ | public boolean shouldFilter() { | ||
+ | RequestContext context = RequestContext.getCurrentContext(); | ||
+ | return " | ||
+ | } | ||
+ | </ | ||
+ | |||
===== 참고 ===== | ===== 참고 ===== | ||
줄 22: | 줄 70: | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// |