2012-08-14 3 views
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> 

답변

1

지속 시간 Param은 밀리 초 단위로 설정되며 3000을 구성하므로 항상 중단됩니다. 당신이 supension에 대한 에러를 제어하고 싶다면 당신은 이와 같이 target 섹션에서 contron해야합니다.

<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> 

관련 문제