最近某电信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);
//------