gpt4 book ai didi

WSO2 ESB 服务代理未根据配置超时

转载 作者:行者123 更新时间:2023-12-03 20:13:15 25 4
gpt4 key购买 nike

我们正在使用最新版本的 WSO2 ESB(4.6.0)。我们正在探索将代理服务实现到 Web 服务。详情如下:

使用 WSO2 设置 Axis2 Webservice 自定义服务代理。配置如下:代理 XML:此突触配置是使用 WSO2 UI 生成的。

 <proxy xmlns="http://ws.apache.org/ns/synapse" name="StockQuoteProxy" transports="https,http" statistics="enable" trace="enable" startOnLoad="true">
<target faultSequence="myFaultHandler">
<inSequence>
<property name="DISABLE_CHUNKING" value="true" scope="axis2" type="STRING"/>
</inSequence>
<outSequence>
<send/>
</outSequence>
<endpoint>
<address uri="http://localhost:9000/services/SimpleStockQuoteService">
<timeout>
<duration>3000</duration>
<responseAction>fault</responseAction>
</timeout>
<suspendOnFailure>
<errorCodes>101504,101505</errorCodes>
<initialDuration>1000</initialDuration>
<progressionFactor>2.0</progressionFactor>
<maximumDuration>10000</maximumDuration>
</suspendOnFailure>
<markForSuspension>
<errorCodes>101507,101508,101505,101506,101509,101500,101510,101001,101000,101503,101504,101501</errorCodes>
<retriesBeforeSuspension>1</retriesBeforeSuspension>
<retryDelay>1</retryDelay>
</markForSuspension>
</address>
</endpoint>
</target>
<publishWSDL uri="http:// localhost:9000/services/SimpleStockQuoteService?wsdl"/>
<description></description>
</proxy>

序列 myFaultHandler XML:

<sequence xmlns="http://ws.apache.org/ns/synapse" name="myFaultHandler" trace="enable">
<header name="To" action="remove"/>
<property name="RESPONSE" value="true"/>
<property name="NO_ENTITY_BODY" action="remove" scope="axis2"/>
<log level="custom">
<property xmlns:ns="http://org.apache.synapse/xsd" name="error-message" expression="get-property('ERROR_MESSAGE')"/>
<property xmlns:ns="http://org.apache.synapse/xsd" name="error-code" expression="get-property('ERROR_CODE')"/>
<property xmlns:ns="http://org.apache.synapse/xsd" name="error-detail" expression="get-property('ERROR_DETAIL')"/>
<property xmlns:ns="http://org.apache.synapse/xsd" name="error-exception" expression="get-property('ERROR_EXCEPTION')"/>
</log>
<makefault version="soap12">
<code xmlns:soap12Env="http://www.w3.org/2003/05/soap-envelope" value="soap12Env:Receiver"/>
<reason value="Webservice is either down or currently not reachable."/>
<node></node>
<role></role>
</makefault>
<send/>
</sequence>

当 web 服务关闭时,此配置会按照定义抛出 soap 错误。

当 web 服务需要时间发回响应时,如代理 XML 配置中所定义,它应该在 3 秒后超时:

       <timeout>
<duration>3000</duration>
<responseAction>fault</responseAction>
</timeout>

即使在超时期限之后,代理仍在等待响应,而不是将错误抛回。

在分析日志文件时,我们尝试修改下面提到的属性文件中的以下参数,但线程仍然卡在等待响应中。

**synapse.properties**  
synapse.global_timeout_interval=3000
synapse.connection.read_timeout=3000
synapse.connection.connect_timeout=3000
synapse.timeout_handler_interval=3000

**nhttp.properties**
http.socket.timeout=5000

它最终超时并抛出套接字异常。

根据规范 ( http://wso2.com/library/articles/wso2-enterprise-service-bus-endpoint-error-handling ),在超时发生后,端点应进入超时状态,但在这种情况下,端点仍处于事件状态,既不会出错也不会丢弃消息。有时它会抛出错误代码 504。但此操作并不一致。

如果最终的网络服务非常慢,请告知给定代理服务超时/丢弃消息所需的更改。

最佳答案

如果您使用来自 axis2.xml(位于 CARBON_HOME/repository/conf/axis2 目录)的 http 传输,您可以通过添加参数在该特定传输发送器中配置超时参数来解决此问题。例如,

<parameter name="SO_TIMEOUT">3000</parameter>
<parameter name="CONNECTION_TIMEOUT">3000</parameter>

问候,阿散卡·桑吉瓦。

关于WSO2 ESB 服务代理未根据配置超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17288911/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com