Reputation: 109
How can I use Apache common pool to pool TCP connections and reuse the connection?
To implement a TCP connection pool, I am trying to use Apache common pool(1.6), I used the object pool that is posted in https://javaarchitectforum.com/tag/apache-common-object-pool-example/ to implement it.
I do expect to see persisted TCP connection upon initiating connection to another server and reuse it for other subsequent connection requests.
The issue is, I can not see any persistent connection to the server(netstat -an). By borrowing object, new connection is established and when return the object, socket is disconnected.No pooling!
Am I using correct approach to create TCP pool?
Upvotes: 2
Views: 329
Reputation: 109
Issue is resolved.
Two amendments to resolve the issue:
As a result connections are persisted and reused for next requests.
Upvotes: 2