多种服务-Zuul中的多条路线

时间:2018-10-03 16:39:11

标签: spring-boot netflix-zuul netflix-ribbon

我有两个带有休息端点的不同微服务。我想在YML中配置多个服务和多个路由。这是正确的做法吗?

zuul:
  ignoredServices: "*"
  routes:
    MICROSERVICE-1:
      path: /service1/**
      serviceId: MICROSERVICE1
      servicePath: /XYZ/
    MICROSERVICE-2:
      path: /service2/**
      serviceId: MICROSERVICE2
      servicePath: /ABC
  retryable: true    

MICROSERVICE-1:
  ribbon:
    serviceId: MICROSERVICE-1:
    eureka.enabled: true
    ServerListRefreshInterval: 1000
    okToRetryOnAllErrors : true
    okRetryOnConnectionErrors : true
MICROSERVICE-2:
  ribbon:
    serviceId: MICROSERVICE-2
    eureka.enabled: true
    ServerListRefreshInterval: 1000
    okToRetryOnAllErrors : true
    okRetryOnConnectionErrors : true

0 个答案:

没有答案