public interface HttpClientSpec
Modifier and Type | Method and Description |
---|---|
HttpClientSpec |
byteBufAllocator(ByteBufAllocator byteBufAllocator)
The buffer allocator to use.
|
HttpClientSpec |
connectTimeout(Duration connectTimeout)
The read timeout value for responses.
|
HttpClientSpec |
maxContentLength(int maxContentLength)
The maximum size to allow for responses.
|
HttpClientSpec |
poolSize(int poolSize)
The maximum number of connections to maintain to a given protocol/host/port.
|
HttpClientSpec |
readTimeout(Duration readTimeout)
The read timeout value for responses.
|
HttpClientSpec |
responseMaxChunkSize(int numBytes)
The max size of the chunks to emit when reading a response as a stream.
|
HttpClientSpec byteBufAllocator(ByteBufAllocator byteBufAllocator)
Defaults to PooledByteBufAllocator.DEFAULT
.
byteBufAllocator
- the buffer allocatorthis
HttpClientSpec poolSize(int poolSize)
Defaults to 0.
Setting this number to > 0 enables connection pooling (a.k.a. HTTP Keep Alive).
The given value dictates the number of connections to a given target, not the overall size.
Calling HttpClient.close()
will close all current connections.
poolSize
- the connection pool sizethis
HttpClientSpec maxContentLength(int maxContentLength)
Defaults to ServerConfig.DEFAULT_MAX_CONTENT_LENGTH
.
maxContentLength
- the maximum response content lengththis
HttpClientSpec readTimeout(Duration readTimeout)
Defaults to 30 seconds.
readTimeout
- the read timeout value for responsesthis
HttpClientSpec connectTimeout(Duration connectTimeout)
Defaults to 30 seconds.
connectTimeout
- the read timeout value for responsesthis
HttpClientSpec responseMaxChunkSize(int numBytes)
Defaults to 8192.
Increasing this value can increase throughput at the expense of memory use.
numBytes
- the max number of bytes to emitthis