WSO2 ESB 非挂起端点超时指定问题

WSO2 ESB non-suspend endpoint timeout specifying issue

我想将非挂起端点的超时持续时间指定为 3000 毫秒(3 秒)。我使用了 WSO2 文档中的配置并将我的端点文件配置如下:

<?xml version="1.0" encoding="UTF-8"?>
<endpoint name="myEndpointFile" xmlns="http://ws.apache.org/ns/synapse">
<property expression="get-property('endpointAddress')" name="endpointAddress"/>
<address uri="${endpointAddress}">
        <timeout>
           <duration>3000</duration>
           <responseAction>fault</responseAction>
       </timeout>
       <suspendOnFailure>
           <errorCodes>-1</errorCodes>
           <initialDuration>0</initialDuration>
           <progressionFactor>1.0</progressionFactor>
           <maximumDuration>0</maximumDuration>
       </suspendOnFailure>
       <markForSuspension>
           <errorCodes>-1</errorCodes>
       </markForSuspension>
</address>

为了能够对其进行测试,我使用了一个具有 7000 毫秒(7 秒)响应延迟的 mocky.io 端点 http://www.mocky.io/v2/5e7b12732d00008f00119be6?mocky-delay=7000ms

当我尝试调用调用该端点 URL 的 API 时,我仍然成功 HTTP 200 OK 即使我的超时持续时间是 3000 毫秒(3 秒)。

这是我在 synapse.properties 中的 synapse.global_timeout_interval 参数:

synapse.global_timeout_interval=200000

还有我的 http.socket.timeout 属性 中的值-http.properties:

http.socket.timeout=180000

版本:WSO2EI6.4.0

感谢任何想法!

此致

我简单介绍一下超时处理程序的过程。当我们调用一个端点时,ESB 会注册一个回调,并在有任务时检查是否超过超时时间。当任务识别出注册的回调超过超时期限时,它会删除注册的回调。

您定义的超时值非常小。默认情况下,使请求超时的任务每 15 秒运行一次。您可以使用 timeout_handler_interval 参数 [1].

但不建议将此值降低到非常低的值。由于此任务以 15 秒为间隔 运行,因此实际超时可能发生在 3 秒(最佳情况)到 3 +15 秒(范围 3 秒到 18 秒)的范围内。

[1]-http://sanjeewamalalgoda.blogspot.com/2016/07/how-endpoint-timeouts-and-timeout.html