Interface HttpSenderConfig


@Immutable public interface HttpSenderConfig
Configuration for HttpSender implementations, provided via HttpSenderProvider.createSender(HttpSenderConfig).
Since:
1.59.0
  • 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 the Content-Type header.
    • getCompressor

      @Nullable Compressor getCompressor()
      The compressor, or null if no compression is used. If present, Compressor.compress(OutputStream) must be applied to MessageWriter.writeMessage(OutputStream) when HttpSender.send(MessageWriter, Consumer, Consumer) is called and Compressor.getEncoding() must be set as the Content-Encoding header.
    • getTimeout

      Duration getTimeout()
      The max duration allowed to send a request, including resolving DNS, connecting, writing the request, reading the response, and any retries via getRetryPolicy().
    • getConnectTimeout

      Duration getConnectTimeout()
      The max duration allowed to connect to a target host.
    • getHeadersSupplier

      Supplier<Map<String,List<String>>> getHeadersSupplier()
      Additional headers that must be appended to every request. The resulting Supplier must be invoked for each request.
    • getProxyOptions

      @Nullable ProxyOptions getProxyOptions()
      The proxy options, or null if no proxy is used.
    • getRetryPolicy

      @Nullable RetryPolicy getRetryPolicy()
      The retry policy, or null if retry is disabled.
    • getSslContext

      @Nullable SSLContext getSslContext()
      The SSL context to use, or null if the system default is used. If non-null, getTrustManager() will also be non-null.
    • getTrustManager

      @Nullable X509TrustManager getTrustManager()
      The trust manager to use, or null if the system default is used. If non-null, getSslContext() will also be non-null.
    • getExecutorService

      @Nullable ExecutorService getExecutorService()
      The executor service used to execute any asynchronous processing, or null if 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