Xfire開發的webservice客戶端超時問題解決

最近某電信ISAG升級後咱們的客戶端出現大量超時提示,而且下發很慢
[MeChannelGw]2010-06-10 06:00:05 (HttpMethodBase.java:2102)-[INFO] Timer-1 - 100 (continue) read timeout. Resume sending the request
[MeChannelGw]2010-06-10 06:00:08 (HttpMethodBase.java:2102)-[INFO] Timer-1 - 100 (continue) read timeout. Resume sending the request
[MeChannelGw]2010-06-10 06:00:11 (HttpMethodBase.java:2102)-[INFO] Timer-1 - 100 (continue) read timeout. Resume sending the request
[MeChannelGw]2010-06-10 06:00:14 (HttpMethodBase.java:2102)-[INFO] Timer-1 - 100 (continue) read timeout. Resume sending the request
[MeChannelGw]2010-06-10 06:00:17 (HttpMethodBase.java:2102)-[INFO] Timer-1 - 100 (continue) read timeout. Resume sending the request
每隔3-4秒才下發一次數據。

曾覺得是對方服務器問題,網絡的問題等等,就是換臺機器部署,仍是會有這個問題。實際,上由於Xfire默認的機制下,會不斷的去和服務端握手形成的。 調用下面的代碼便可解決問題。

//----------
  HttpClientParams params = new HttpClientParams();
            params.setParameter(HttpClientParams.USE_EXPECT_CONTINUE,Boolean.FALSE);
            params.setParameter(HttpClientParams.CONNECTION_MANAGER_TIMEOUT, 10*1000L);
            Client.getInstance(service).setProperty(CommonsHttpMessageSender.HTTP_CLIENT_PARAMS,params);
//------
相關文章
相關標籤/搜索