Provide `ConnectionProvider` configuration for limiting the number of the connection pools
This is a follow up issue for https://github.com/reactor/reactor-netty/issues/3315#issuecomment-2188770825
@violetagg when read from
https://projectreactor.io/docs/netty/release/api/reactor/netty/resources/ConnectionProvider.htm Build a ConnectionProvider to cache and reuse a fixed maximum number of Connection.
but here https://projectreactor.io/docs/netty/1.2.0-M4/reference/tcp-client.html Connections used by the TcpClient are never returned to the pool, but closed. When a connection is closed, a slot is freed in the pool and thus a new connection can be opened when needed.
so, how can ConnectionProvider reuse connection? any one can help?
@cloudzhou for TCP client you cannot reuse the connections, the connection pool is used to limit the number of the connections that you can open.
so confused about that, TCP client and reuse connections is so common and important the default implement need to pooled and reuse connections as base usage
@cloudzhou as we pointed in the documentation https://projectreactor.io/docs/netty/1.2.0-M4/reference/tcp-client.html#connection-pool we don't know what protocol is used on top of TCP and whether the connections are recycled and ready to be reused.
so is there a recommend way to pooled and reuse the connection? some document or open source code demo?
@cloudzhou Take a look at R2DBC pool https://github.com/r2dbc/r2dbc-pool (it uses TcpClient)
If you have more questions let's continue on Gitter