Interface HttpSenderConfig
@Immutable
public interface HttpSenderConfig
Configuration for
HttpSender implementations, provided via HttpSenderProvider.createSender(HttpSenderConfig).- Since:
- 1.59.0
-
Method Summary
Modifier and TypeMethodDescriptionThe compressor, ornullif no compression is used.The max duration allowed to connect to a target host.The payload content type to set as theContent-Typeheader.The fully qualified endpoint to send to, including scheme and path.The executor service used to execute any asynchronous processing, ornullif the sender default executor service should be used.Additional headers that must be appended to every request.default longThe maximum number of bytes to read from a response body.The proxy options, ornullif no proxy is used.The retry policy, ornullif retry is disabled.The SSL context to use, ornullif the system default is used.The max duration allowed to send a request, including resolving DNS, connecting, writing the request, reading the response, and any retries viagetRetryPolicy().The trust manager to use, ornullif the system default is used.
-
Method Details
-
getEndpoint
URI getEndpoint()The fully qualified endpoint to send to, including scheme and path. -
getContentType
String getContentType()The payload content type to set as theContent-Typeheader. -
getCompressor
The compressor, ornullif no compression is used. If present,Compressor.compress(OutputStream)must be applied toMessageWriter.writeMessage(OutputStream)whenHttpSender.send(MessageWriter, Consumer, Consumer)is called andCompressor.getEncoding()must be set as theContent-Encodingheader. -
getTimeout
Duration getTimeout()The max duration allowed to send a request, including resolving DNS, connecting, writing the request, reading the response, and any retries viagetRetryPolicy(). -
getConnectTimeout
Duration getConnectTimeout()The max duration allowed to connect to a target host. -
getHeadersSupplier
Additional headers that must be appended to every request. The resultingSuppliermust be invoked for each request. -
getProxyOptions
The proxy options, ornullif no proxy is used. -
getRetryPolicy
The retry policy, ornullif retry is disabled. -
getSslContext
The SSL context to use, ornullif the system default is used. If non-null,getTrustManager()will also be non-null. -
getTrustManager
The trust manager to use, ornullif the system default is used. If non-null,getSslContext()will also be non-null. -
getExecutorService
The executor service used to execute any asynchronous processing, ornullif the sender default executor service should be used. -
getMaxResponseBodySize
default long getMaxResponseBodySize()The maximum number of bytes to read from a response body. Defaults to 4 MiB.Warning: setting a high or unbounded limit allows a malicious or misconfigured server to cause unbounded heap allocation, potentially leading to out-of-memory errors.
- Since:
- 1.61.0
-