Skip to content

Configure HTTP Clients

Alan Zimmer edited this page Jan 9, 2023 · 1 revision

NettyAsyncHttpClient

ConnectionProvider

ConnectionProvider allows for in-depth customizations to the connection pool used by the Reactor Netty HttpClient that backs NettyAsyncHttpClient. By default, without setting a ConnectionProvider a default ConnectionProvider will be used that is managed by Reactor Netty with the defaults they chose, by setting a custom ConnectionProvider the following can be configured:

  • Maximum number of connections (maxConnections).
  • Maximum idle time before a connection is close (maxIdleTime).
  • Maximum lifetime of a connection (maxLifeTime).
  • Maximum number of pending connections (pendingAcquireMaxCount).
  • Maximum time a pending connection will wait before timing out (pendingAcquireTimeout).

There are a few other configurations not mentioned, all details can be found at Reactor Netty's user reference.

NOTE: At the time of writing, when constructing a Reactor Netty HttpClient without a specified ConnectionProvider a default of 500 maximum connections and 1000 pending connections will be used, if a ConnectionProvider is specified without setting maxConnections it will default to the maximum of 16 or 2 * available number of processors and pending connections will be 2 * maxConnections.

Clone this wiki locally