我有一项服务。如果端点在 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>
持续时间参数
以毫秒为单位,您正在配置 3000,因此它始终挂起。如果你想控制 supension 的误差,你必须像这样控制目标部分。
<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>