WSO2 ESB HTTP 连接被远程主机强行关闭 [英] WSO2 ESB HTTP connection was forcibly closed by remote host

查看:36
本文介绍了WSO2 ESB HTTP 连接被远程主机强行关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用 WSO2 ESB 克隆 SOAP 请求并将其广播到我们所有的 Web 服务,这些 Web 服务托管在 IIS 上.最近我们切换到 nhttp 传输.它被配置为推荐的here,但每次在不活动期之后,我们都会遇到wso.log 中的异常

We are using WSO2 ESB to clone and broadcast SOAP requests to all our web services, that are being hosted on IIS. Recently we switched to nhttp transport. It was configured as recommended here but each time after the period of inactivity we encount an exception in wso.log

[HTTP Sender I/O dispatcher-4] ERROR ClientHandler I/O error : An existing connection was forcibly closed by the remote host For : 127.0.0.1:4148
java.io.IOException: An existing connection was forcibly closed by the remote host
    at sun.nio.ch.SocketDispatcher.read0(Native Method)
    at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
    at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
    at sun.nio.ch.IOUtil.read(IOUtil.java:197)
...

不活动期的长度取决于在 IIS 中为特定 Web 服务配置的 'Connection Time-out value'.似乎 WSO2 ESB 没有关闭所有打开的套接字连接,而 IIS 却在超时期限到期时关闭了.

The length of inactivity period depends on the 'Connection Time-out value' configured in IIS for the specific web service. Seems like WSO2 ESB hasn't closed all opened socket connections and IIS did it instead, when the time-out period has expired.

有没有办法避免这个异常?它似乎不会导致一些性能缺陷,但在错误日志中看起来相当混乱.

Is there is a way to avoid this exception? It doesn't seem to cause some performance drawbacks, but looks quite messy in the error logs.

我们的配置,负责线程计数和超时如下:

Our configuration, responsible for threads count and timeouts is as follow:

nhttp.properties 文件:

nhttp.properties file:

http.socket.timeout=120000
nhttp_buffer_size=16384
http.tcp.nodelay=1
http.connection.stalecheck=0
http.block_service_list=false

synapse.properties 文件:

synapse.properties file:

synapse.threads.core = 40
synapse.threads.max = 100
#synapse.threads.keepalive = 5
#synapse.threads.qlen = 10
#synapse.threads.group = synapse-thread-group
#synapse.threads.idprefix = SynapseWorker

synapse.sal.endpoints.sesssion.timeout.default=600000
synapse.global_timeout_interval=120000 

推荐答案

默认情况下,WSO2 ESB 将使用 'KEEPALIVE' 进行连接.当后端(例如 IIS)不使用KEEPALIVE"时,这将导致现有连接被远程主机强制关闭"错误消息.使用以下属性禁用KEEPALIVE":

By default WSO2 ESB will use 'KEEPALIVE' for connections. This will result in 'An existing connection was forcibly closed by the remote host' error message when the backend (e.g. IIS) does not use 'KEEPALIVE'. Use the following property to disable 'KEEPALIVE':

<property name="NO_KEEPALIVE" value="true" scope="axis2" type="STRING"/>

这可能/可能不直观,但是这个属性"条目被插入到您要连接的后端服务的代理服务的in"序列中.看来作者正在其中一个 .properties 文件中寻找更全局的设置.有,但既不是 nhttp.properties 也不是 synapse.properties.这将是 [carbon_home]/repository/conf/passthru-http.properties 中的设置,并设置以下内容以禁用 keepalive:http.connection.disable.keepalive=true

It may/may not be intuitively obvious, but this "property" entry is inserted into the "in" sequence of the proxy service for the backend service to which you are connecting. It appeared the author was looking for a more global setting in one of the .properties files. There is, but neither for nhttp.properties nor synapse.properties. It would be the setting in [carbon_home]/repository/conf/passthru-http.properties and set the following to disable keepalive: http.connection.disable.keepalive=true

这篇关于WSO2 ESB HTTP 连接被远程主机强行关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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