사용자 도구

사이트 도구


java:zuul

문서의 이전 판입니다!


Zuul - API Gateway

Netflix의 Client Serving Server

Spring Cloud Neflix Zuul

다중 path 지정

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));
  }

참고

java/zuul.1636420493.txt.gz · 마지막으로 수정됨: 2021/11/09 10:14 저자 kwon37xi