如何在Spring Cloud Gateway中配置IOExceptions的重试?

时间:2018-05-24 23:02:33

标签: spring-cloud spring-cloud-gateway

我看到Retry Filter支持基于http状态代码的重试。我想在io例外情况下配置重试,例如连接重置。是否可以使用Spring Cloud Gateway 2?

1 个答案:

答案 0 :(得分:1)

我使用的是2.0.0.RC1。看起来最新的构建快照支持基于异常的重试。手指越过下一个版本。 以下是针对500系列错误或IOExceptions重试两次的示例:


        filters:
        - name: Retry
          args:
            retries: 2
            series:
            - SERVER_ERROR
            exceptions:
            - java.io.IOException