====== Zuul - API Gateway ======
* [[https://github.com/Netflix/zuul|zuul]]
* [[msa:gateway_routing_pattern|MSA - Gateway Routing Pattern]]
* [[https://github.com/Netflix/zuul/wiki/How-We-Use-Zuul-At-Netflix|How We Use Zuul At Netflix · Netflix/zuul Wiki]]
* [[https://netflixtechblog.com/announcing-zuul-edge-service-in-the-cloud-ab3af5be08ee|Announcing Zuul: Edge Service in the Cloud | by Netflix Technology Blog | Netflix TechBlog]]
* [[:springframework|Spring Framework]] 기반 개발자들에게는 [[springframework:cloud_gateway|Spring Cloud Gateway]]가 더 적합해보인다.
* [[https://github.com/Netflix/zuul/wiki|Home · Netflix/zuul Wiki]]
* [[http://cloud.spring.io/spring-cloud-netflix/|Spring Cloud Netflix]]
===== Spring Cloud Neflix Zuul =====
* [[https://cloud.spring.io/spring-cloud-netflix/multi/multi__router_and_filter_zuul.html|Spring Cloud Neflix Zuul]]
* [[https://spring.io/guides/gs/routing-and-filtering/|Getting Started · Routing and Filtering]]
* [[https://supawer0728.github.io/2018/03/11/Spring-Cloud-Zuul/|(Spring Cloud) Zuul ]]
* [[https://www.baeldung.com/spring-rest-with-zuul-proxy|Spring REST with a Zuul Proxy]]
* [[http://woowabros.github.io/r&d/2017/06/13/apigateway.html|배민 API GATEWAY - spring cloud zuul 적용기 - 우아한형제들 기술 블로그]]
* [[https://www.slideshare.net/MikeyCohen1/zuul-netflix-springone-platform|Zuul @ Netflix SpringOne Platform]]
==== 다중 path 지정 ====
* [[https://stackoverflow.com/questions/28662237/multiple-zuul-routes-to-one-service/28665239|spring cloud - Multiple Zuul routes to one service - Stack Overflow]]
* ''serviceId''는 필요에 따라.
zuul:
routes:
myserver_mypath:
path: /mypath/**
url: ....
serviceId: myserver
myserver_another_path:
path: /anotherpath/**
url: ...
serviceId: myserver
==== actuator ====
* ''/actuator/routes''
* boot 2.1 의 경우 ''management.endpoints.web.exposure.include=routes'' 처럼 지정해 줘야 활성화 됨. 혹은 ''*''
==== Filter ====
=== Service ID 알아내기 ===
* 'org.springframework.cloud.netflix.zuul.filters.support.FilterConstants#SERVICE_ID_KEY'' 사용
@Override
public boolean shouldFilter() {
RequestContext context = RequestContext.getCurrentContext();
return "member-api".equals(context.get(SERVICE_ID_KEY));
}
===== 참고 =====
* [[https://spring.io/blog/2016/12/01/springone-platform-2016-replay-netflix-s-edge-gateway-using-zuul|SpringOne Platform 2016 Replay: Netflix's Edge Gateway Using Zuul]]
* [[https://medium.com/knerd/api-infrastructure-at-knewton-whats-in-an-edge-service-51a3777aeb41|API Infrastructure at Knewton: What’s in an Edge Service?]]
* [[https://github.com/Netflix/zuul/wiki/How-We-Use-Zuul-At-Netflix|How We Use Zuul At Netflix · Netflix/zuul Wiki]]
* [[https://dzone.com/articles/dynamic-routing-through-zuul-with-rest-api-spring|Dynamic Routing Through Zuul With a REST API and Spring Boot Without Spring Config — Sub-Domain to Subpath Router - DZone Microservices]]
* [[https://netflixtechblog.com/announcing-zuul-edge-service-in-the-cloud-ab3af5be08ee|Announcing Zuul: Edge Service in the Cloud | by Netflix Technology Blog | Netflix TechBlog]]
* [[https://philcalcado.com/2015/09/18/the_back_end_for_front_end_pattern_bff.html|The Back-end for Front-end Pattern (BFF)]]
* [[https://metleeha.tistory.com/entry/BFFBackend-for-Frontend-%EB%9E%80|BFF(Backend for Frontend) 란?]]
* [[https://www.kennethlange.com/backends-for-frontends-pattern/|The Backends for Frontends (BFF) Pattern]]