[英]How to deal timeout error?
我有服務 如果端點在30秒內無法響應。 我將丟棄消息。 我在端點中設置了此值,但沒有用,有人告訴我這是一個錯誤。 所以我想使用一個錯誤序列來解決這個問題。 但是還是失敗了。 有人可以告訴我該怎么做嗎?
If the endpoint can not response in 30 seconds, then execute EndpointError sequence.
Best regards.
<proxy xmlns="http://ws.apache.org/ns/synapse" name="EndpointTest" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
<target>
<inSequence onError="EndpointError">
<log level="full" />
</inSequence>
<outSequence onError="EndpointError">
<log level="full" />
<send />
</outSequence>
<endpoint>
<address uri="http://172.21.11.158:48280/portalAgent/services/receiveMsg" format="pox">
<timeout>
<duration>3000</duration>
<responseAction>discard</responseAction>
</timeout>
</address>
</endpoint>
</target>
</proxy>
參數Param的持續時間以毫秒為單位,您正在配置3000,因此它總是會掛起。 如果要控制錯誤,則必須像這樣在目標區域中進行控制。
<proxy xmlns="http://ws.apache.org/ns/synapse" name="EndpointTest" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
<target faultSequence="EndpointError">
<inSequence onError="EndpointError">
<log level="full" />
</inSequence>
<outSequence onError="EndpointError">
<log level="full" />
<send />
</outSequence>
<endpoint>
<address uri="http://172.21.11.158:48280/portalAgent/services/receiveMsg" format="pox">
<timeout>
<duration>30000</duration>
<responseAction>discard</responseAction>
</timeout>
</address>
</endpoint>
</target>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.