Announcement Announcement Module
Collapse
No announcement yet.
Broken pipe socket exception occurred when implementing the tcp connection pool Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Broken pipe socket exception occurred when implementing the tcp connection pool

    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.


    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" />
    But I am experiencing an issue when using the app after a long idle time.




    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
    Thanks in advance for any guidance related to this.

  • #2
    Please don't post the same question twice; I answered on the other thread.

    Comment


    • #3
      I'm sorry for the inconvenience caused to you.

      Comment

      Working...
      X