Axis Web服务的Keep Alive [英] Axis Web Service Keep Alive

查看:412
本文介绍了Axis Web服务的Keep Alive的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Tomcat的运行Axis Web服务。接近头在HTTP 1.1,这意味着默认为保持活动:客户端不发送连接进行连接。不幸的是,客户端似乎有一个问题,当它到达一个异常的客户端没有关闭连接。由于这些客户在批量作业发送大量的流量,这个迅速吞噬了我的所有连接。我想迫使我的web服务,尽快关闭每个连接为一个特定的处理程序(扩展BasicHandler)完成。

I have an axis web service running in Tomcat. Clients are making connections without sending a Connection: close header in HTTP 1.1 which means that the default is Keep-Alive. Unfortunately the client seems to be having a problem and when it gets an exception the client is not closing the connection. Since these clients are sending lots of traffic in batch jobs this quickly eats up all my connections. I want to force my web service to close each connection as soon as a particular Handler (extends BasicHandler) completes.

我如何做到这一点?即我如何强制服务器调用BasicHandler#的invoke()后关闭连接?

How do I do this? I.e. how do I force the server to close a connection after calling BasicHandler#invoke()?

推荐答案

在你的tomcat的server.xml文件中,找到HTTP连接器定义(它与协议元素=HTTP / 1.1),并添加的KeepAliveTimeout属性,这里详细介绍:

In your tomcat's server.xml file, find the HTTP Connector definition (it's the element with protocol="HTTP/1.1"), and add the keepAliveTimeout attribute, as detailed here:

http://tomcat.apache.org/tomcat-6.0- DOC /配置/ http.html

您将有不同的值进行试验,看看它给你你想要的行为。退房的其他设置也,有些人可能对你有用。

You'll have to experiment with different values to see which gives you the behaviour you want. Check out the other settings also, some might be useful to you.

请注意,这是在Tomcat 6的文档,所以不是所有的选项可能在Tomcat 5上工作,所以检查的tomcat的相同部分5文档。

Note that that's the Tomcat 6 docs, so not all options might work on tomcat 5, so check the same part of the tomcat 5 docs.

这篇关于Axis Web服务的Keep Alive的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆