목차

Zuul - API Gateway

Spring Cloud Neflix Zuul

다중 path 지정

zuul:
  routes:
    myserver_mypath:
      path: /mypath/**
      url: ....
      serviceId: myserver
    myserver_another_path:
      path: /anotherpath/**
      url: ...
      serviceId: myserver

actuator

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

참고