APIM 节流时的 HTTP return 代码是什么?

What is the HTTP return code in case of APIM throttling?

我们通过 WSO2 API 管理器(当前为 v2.1,但很快将切换到 v2.6)发布器发布了一个 API,并将其限制为最大 100 req/s(高级节流规则)。 如果请求过多达到每秒允许的最大值,HTTP return 代码是什么?

此 WSO2 文档页面: https://docs.wso2.com/display/AM260/Error+Handling 给出了许多 APIM 错误代码(包括那些用于节流限制的错误代码)但是与 HTTP 代码的绑定不完整,我们需要将其提供给我们的客户端。

900802 APIM 错误代码是否像 900801 一样绑定到 HTTP 429 错误代码? 900803 和 900807 之间的代码呢?

感谢您的帮助。

以下是 HTTP 状态代码。

  • 900801 - 503
  • 900802 - 429
  • 900803 - 429
  • 900804 - 429
  • 900805 - 429
  • 900806 - 429
  • 900807 - 429

您可以使用 [1]、[2] 和 [3] 来识别这些代码。

[1] - https://github.com/wso2/carbon-apimgt/blob/53123b847047564cc342cbbed76c9ccf8a097516/components/apimgt/org.wso2.carbon.apimgt.gateway/src/main/java/org/wso2/carbon/apimgt/gateway/handlers/throttling/APIThrottleConstants.java#L23

[2] - https://github.com/wso2/carbon-apimgt/blob/c95361146f7ee15f80f61611a97066545c35664d/components/apimgt/org.wso2.carbon.apimgt.gateway/src/main/java/org/wso2/carbon/apimgt/gateway/handlers/throttling/ThrottleHandler.java#L620

[3] - https://github.com/wso2/carbon-apimgt/blob/53123b847047564cc342cbbed76c9ccf8a097516/components/apimgt/org.wso2.carbon.apimgt.gateway/src/main/java/org/wso2/carbon/apimgt/gateway/handlers/throttling/APIThrottleHandler.java#L267