1

我有服务。如果端点不能在 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>
4

1 回答 1

1

持续时间参数以毫秒为单位,您正在配置 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>

于 2012-08-23T19:47:09.007 回答