【问题标题】:How to deal timeout error?如何处理超时错误?
【发布时间】:2012-08-14 01:22:18
【问题描述】:

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

【问题讨论】:

    标签: timeout wso2 endpoint wso2carbon


    【解决方案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>
    

    【讨论】:

      猜你喜欢
      • 2019-06-28
      • 1970-01-01
      • 2015-05-07
      • 2017-04-07
      • 2013-05-02
      • 1970-01-01
      • 1970-01-01
      • 2020-11-12
      • 1970-01-01
      相关资源
      最近更新 更多