spring.cloud.gateway.routes.filters.fallbackUri не работает - PullRequest
0 голосов
/ 22 июня 2019
  1. Я установил точку останова в других службах, а затем смоделировал время ожидания, но fallbackUri не вступил в силу. в версии -> 2.1.6. РЕЛИЗ

  2. В результате ответа http не ожидалось ввести: @RequestMapping ("/ fallback / pms-admin")

JSON:

{
    "timestamp": "2019-06-22T08:45:39.786+0000",
    "path": "/pms-admin/login",
    "status": 504,
    "error": "Gateway Timeout",
    "message": "Response took longer than configured timeout"
}
  1. вниз - это мой bootstrap.yml

    server:
      port: 3333
    hystrix.command.adminFallbackCommand.execution.isolation.thread.timeoutInMilliseconds: 5000
    spring:
      application:
        name: service-pms-api-gateway
      cloud:
        consul:
          host: 10.7.16.135
          port: 8500
          discovery:
            enabled: true
            instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${server.port}
            prefer-ip-address: true
            acl-token: da8089e7-287a-e998-e1dd-d2cc919086ae
        gateway:
          discovery:
            locator:
              enabled: true
          routes:
            # This route rule used to forward request to activity server
            - id: pms-admin
              uri: lb://service-pms-auth
              predicates:
                - Path=/pms-admin/**
              filters:
              - name: Hystrix
                args:
                  name: adminFallbackCommand
                  fallbackUri: forward:/fallback/pms-admin


    logging:
      config: classpath:logback.xml

```yaml


...