Hi


I am tring to implement a connection pool for tcp connections.


I went through the CachingTcpConnectionFactory on

https://github.com/garyrussell/sandb...onFactory.java


So I am doing this post just for clarify some questions.

Code:
<int-ip:tcp-connection-factory id="client"
		deserializer="deserializer" type="client" host="${socket.host}"
		port="${socket.port}" so-timeout="60000" />

<bean id="caching" class="com.infrastructure.connection.CachingTcpConnectionFactory">
	<constructor-arg ref="client" />
	<property name="poolSize" value="10" />
	<property name="availableTimeout" value="10000"/>
	
	</bean>



	<int-ip:tcp-outbound-gateway id="outGateway"
		request-channel="sendStringMessageChannel" reply-channel="recieveStringMessageChannel"
		connection-factory="caching" request-timeout="10000" reply-timeout="10000" />


If I am using the tcp-outbound-gateway instead of adapters is there any way to get the response if I returned the CachedConnection object which extends AbstractTcpConnectionInterceptor?

Do I have to register the sender and listner for the CachedConnection object?

Could you please guide me on this.


But with out returning the CachedConnection object I just return the TcpConnection object and I was able to get the response.

I cannot figure out how to overide the close() to add used connections to the available BlockingQueue and removed from the inUse Set if Im not returning a CachedConnection object which extends AbstractTcpConnectionInterceptor

So is there any way to overide the close() while using the tcp-outbound-gateway ?


Thanks in advance for any explanation on this.