Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-3146

Tcp connection pool is not working after 1 minute

    XMLWordPrintable

    Details

      Description

      I have SOAP service, which used tcp connections for interaction with external service. I'm use connection pool for this tcp service. When I start my app and send first SOAP request - all works fine, but if I'm wait 1 min - then I don't get the response. But when I sniff traffic with Wireshark - I see, what response is returned. And small additional - if I'm no wait 1 minute and send new requests - all works fine. Problem occurs only if the wait 1 minute. This my configuration for pool and tcp:

      <beans profile="single">
          <bean id="testConnectionFactory" class="com.test.provider.impl.ProviderTcpConnectionFactory">
              <constructor-arg name="host" value="localhost"/>
              <constructor-arg name="port" value="7700"/>
              <property name="connectionTimeout" value="10000"/>
              <property name="soTimeout" value="60000"/>
              <property name="deserializer" ref="testDeserializer"/>
              <property name="singleUse" value="true"/>
          </bean>
      </beans>
      
      <beans profile="pool">
          <bean id="testConnection" class="com.test.provider.impl.ProviderTcpConnectionFactory">
              <constructor-arg name="host" value="localhost"/>
              <constructor-arg name="port" value="7700"/>
              <property name="connectionTimeout" value="10000"/>
              <property name="soTimeout" value="60000"/>
              <property name="deserializer" ref="testDeserializer"/>
              <property name="singleUse" value="true"/>
          </bean>
          <bean id="testConnectionFactory" class="org.springframework.integration.ip.tcp.connection.CachingClientConnectionFactory">
              <constructor-arg ref="testConnection"/>
              <constructor-arg value="5"/>
          </bean>
      </beans>
      

      In logs I see next line

      "DEBUG [org.springframework.integration.ip.tcp.connection.TcpNetConnection] Closed single use socket after timeout"
      As I understand - socket closed after soTimeout is expired. But how to use pool without closing connections?

        Attachments

          Activity

            People

            Assignee:
            grussell Gary Russell
            Reporter:
            vladislav_lysov Vladislav Lysov
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: