Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

Sockets getting closed after 200 seconds

$
0
0
Hi ,
I am running into a strange problem of sockets getting closed after exact
200seconds. My application is OSGI bases running with servicemix ,
camel-cxf version 2.8-fuse-06-11. Routes are built using DSL in Java
Classes.
A - Client
B - Server

1) Client is submiting the request(It re-uses at its end and sending us
COnnection:Keep-Alive) and it keeps on sending the request by re-using the
connections.
2) When there is no traffic for 200 seconds, the socket is closed by the
Server but Client is still assuming that socket is open as it has requested
to Keep-Alive connections. When Client send a new request after 200 seconds
assuming the socket is still intact, it gets broken pipe exception and I can
see FIN/ACK in the tcpdumps at Server Side.
3) Server has routes configured to expose webservices and here is my spring
configuration file:-

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/spring"
xmlns:cxf="http://cxf.apache.org/core"
xmlns:ccxf="http://camel.apache.org/schema/cxf"
xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
xmlns:osgi="http://www.springframework.org/schema/osgi"
xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"

xsi:schemaLocation=" http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://camel.apache.org/schema/osgi
http://camel.apache.org/schema/osgi/camel-osgi.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
http://camel.apache.org/schema/cxf
http://camel.apache.org/schema/cxf/camel-cxf.xsd
http://www.springframework.org/schema/osgi
http://www.springframework.org/schema/osgi/spring-osgi.xsd
http://cxf.apache.org/transports/http-jetty/configuration
http://cxf.apache.org/schemas/configuration/http-jetty.xsd
http://cxf.apache.org/transports/http/configuration
http://cxf.apache.org/schemas/configuration/http-conf.xsd
http://cxf.apache.org/core
http://cxf.apache.org/schemas/core.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">

<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-ws-security.xml" />
<http-conf:conduit name="*.http-conduit">
<http-conf:client Connection="Keep-Alive"
MaxRetransmits="1"
AllowChunking="false" />
</http-conf:conduit>

<httpj:engine-factory bus="cxf">
<httpj:engine port="0">
<httpj:threadingParameters minThreads="50" maxThreads="3000" />
</httpj:engine>
</httpj:engine-factory>
..............<.....application specific bean definitions ...>

<camelContext id="camelContext-service-sms" trace="true"
xmlns="http://camel.apache.org/schema/spring">
<threadPoolProfile id="defaultThreadPoolProfile" defaultProfile="true"
poolSize="100" maxPoolSize="100" maxQueueSize="1000"
rejectedPolicy="CallerRuns"/>
</camelContext>
</beans>

With above configuration, http-conduit settings does seems to be making any
difference. I also tried setting ReceiveTimeout="0" ConnectionTimeout="0"
but that did not helped either.
Also tried to set http-conf:server parameters using below setting to honor
Keep-Alive HTTP connections.

<http-conf:destination name="*.http-destination">
<http-conf:server HonorKeepAlive="true"/>
</http-conf:destination>

I looked at several posts on Camel, CXF but not sure what is wrong here.

Can anyone help me understand why the sockets are getting closed and how can
I configure my service endpoint/Jetty server to Keep-Alive connection
without getting timeout.

Viewing all articles
Browse latest Browse all 5648

Trending Articles