I had implemented a connection pool for TCP connections using CachingClientConnectionFactory class in Spring 2.2.0 release.
This is the configurations that I used.
But I am experiencing an issue when using the app after a long idle time.Code:<int-ip:tcp-connection-factory id="tcpConnectionFactory" deserializer="deserializer" type="client" host="${socket.host}" port="${socket.port}" so-keep-alive="true"/> <int-ip:tcp-outbound-gateway id="outboundGateway" request-channel="sendStringMessageChannel" reply-channel="recieveStringMessageChannel" connection-factory="tcpConnectionPool" request-timeout="10000" reply-timeout="10000" /> <bean id="tcpConnectionPool" class="org.springframework.integration.ip.tcp.connection.CachingClientConnectionFactory"> <constructor-arg ref="tcpConnectionFactory" /> <constructor-arg type="int" value="50" /> </bean> <bean id="deserializer" class="com.infrastructure.connection.SocketInputStreamDeserializer" />
Thanks in advance for any guidance related to this.Code:Caused by: java.net.SocketException: Broken pipe at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109) at java.net.SocketOutputStream.write(SocketOutputStream.java:141) at org.springframework.integration.ip.tcp.serializer.ByteArrayCrLfSerializer.serialize(ByteArrayCrLfSerializer.java:74) at org.springframework.integration.ip.tcp.serializer.ByteArrayCrLfSerializer.serialize(ByteArrayCrLfSerializer.java:31) at org.springframework.integration.ip.tcp.connection.TcpNetConnection.send(TcpNetConnection.java:70) at org.springframework.integration.ip.tcp.connection.AbstractTcpConnectionInterceptor.send(AbstractTcpConnectionInterceptor.java:122) at org.springframework.integration.ip.tcp.TcpOutboundGateway.handleRequestMessage(TcpOutboundGateway.java:121) ... 92 more


Reply With Quote