Microsoft C#.NET YARP 504网关错误和故障转移

Microsoft C#.NET YARP 504网关错误和故障转移,c#,failover,api-gateway,yarp,C#,Failover,Api Gateway,Yarp,我正在使用Microsoft C#NET作为ASP.NET核心Web API(最新版本)前面的API网关。 YARP用于实习生重定向到许多微服务 问题: 对于从swagger UI执行超过约2分钟的请求,我面临504 http API网关错误。如何设置增加的超时 例:https://URL/swagger/index.html =>执行POST函数=>YARP\U API\U网关=>服务\U API\U端口 2.如果内部服务目标(端点)因任何原因关闭,如何配置到另一个目标的“故障切换”? 例

我正在使用Microsoft C#NET作为ASP.NET核心Web API(最新版本)前面的API网关。 YARP用于实习生重定向到许多微服务

问题:

  • 对于从swagger UI执行超过约2分钟的请求,我面临504 http API网关错误。如何设置增加的超时
  • 例:https://URL/swagger/index.html =>执行POST函数=>YARP\U API\U网关=>服务\U API\U端口


    2.如果内部服务目标(端点)因任何原因关闭,如何配置到另一个目标的“故障切换”?

    例:配置:

       "ReverseProxy": {
        "Routes": [
          {
            "RouteId": "Service1",
            "ClusterId": "ServiceCluster1",
            "Match": {
              "Path": "/api/Action1/{**rest}"
            },
            "Transforms": [
              { "RequestHeadersCopy": "true" },
              { "RequestHeaderOriginalHost": "true" }
            ]
          },
          {
            "RouteId": "Service2",
            "ClusterId": "ServiceCluster2",
            "Match": {
              "Path": "/api/Action2/{**rest}"
            },
            "Transforms": [
              { "RequestHeadersCopy": "true" },
              { "RequestHeaderOriginalHost": "true" }
            ]
          ],
        "Clusters": {
          "ServiceCluster1": {
            "Destinations": {
              "ServiceCluster1/destination1": {
                "Address": "http://localhost:5001/"
              },
              "ServiceCluster1/destination2": {
                "Address": "http://localhost:5002/"
              }
            }
          },
          "ServiceCluster2": {
            "Destinations": {
              "ServiceCluster2/destination1": {
                "Address": "http://localhost:5003/"
              },
              "ServiceCluster2/destination2": {
                "Address": "http://localhost:5004/"
              }
            }
          },
      }