Results 1 to 3 of 3

Thread: Broken pipe socket exception occurred when implementing the tcp connection pool

  1. #1
    Join Date
    Nov 2012
    Posts
    13

    Default 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. #2
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,146

    Default

    Please don't post the same question twice; I answered on the other thread.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  3. #3
    Join Date
    Nov 2012
    Posts
    13

    Default

    I'm sorry for the inconvenience caused to you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •