Interface HttpClientConfiguration


public interface HttpClientConfiguration

HTTP client module configuration.

Since:
1.6
Author:
Jeremy Kuhn
  • Field Details

    • DEFAULT_HTTP_PROTOCOL_VERSIONS

      static final Set<HttpVersion> DEFAULT_HTTP_PROTOCOL_VERSIONS
      Default HTTP versions accepted by the client.
    • USER_AGENT

      static final String USER_AGENT
      Default user agent.
  • Method Details

    • client_event_loop_group_size

      Integer client_event_loop_group_size()

      The number of event loops to allocate to the client.

      If not specified, the number of thread allocated to the root event loop group shall be used.

      Returns:
      the number of threads to allocate
    • pool_max_size

      default Integer pool_max_size()

      The maximum size of the client connection pool.

      Defaults to 2.

      Returns:
      the maximum size of the pool
    • pool_clean_period

      default long pool_clean_period()

      The pool's clean period in milliseconds.

      This specifies the frequency at which unnecessary connections are removed from the active pool and parked until either a request burst requires the connection to be reinstated or until the keep alive timeout is reached in which case the connection is closed and definitely removed from the pool.

      Defaults to 1000 (1 seconds).

      Returns:
      the pool's clean period
    • pool_buffer_size

      Integer pool_buffer_size()

      The pool's request buffer size.

      This represents the limit beyond which requests can't be buffered and are rejectded (null means no limit).

      Returns:
      the pool's request buffer size
    • pool_keep_alive_timeout

      default Long pool_keep_alive_timeout()

      The pool's connection keep alive timeout in milliseconds.

      The represents the time beyond which an inactive connection is closed and removed from the pool (null means no timeout).

      Defaults to 60000.

      Returns:
      the pool
    • pool_connect_timeout

      default long pool_connect_timeout()

      The pool connection timeout in milliseconds.

      Note that this timeout specifies the maximum time to wait for the connection pool to return a connection, this differs from NetClientConfiguration.connect_timeout() which specifies the connection timeout at the socket level.

      Defaults to 60000.

      Returns:
      the pool connection timeout
    • request_timeout

      default long request_timeout()

      The request timeout in milliseconds.

      Defaults to 60000.

      Returns:
      the connection timeout
    • graceful_shutdown_timeout

      default long graceful_shutdown_timeout()

      The graceful shutdown timeout in milliseconds after which a connection is closed even if there are still active exchanges.

      Defaults to 30000.

      Returns:
      the graceful shutdown timeout
    • http_protocol_versions

      default Set<HttpVersion> http_protocol_versions()

      The set of HTTP protocols accepted by the client.

      Defaults to HttpVersion.HTTP_2_0, HttpVersion.HTTP_1_1

      Returns:
      a set of HTTP versions
    • send_user_agent

      default boolean send_user_agent()

      Sends user-agent header.

      Defaults to true

      Returns:
      true to send the user agent, false otherwise.
    • user_agent

      default String user_agent()

      The value of the user-agent header to send.

      Defaults to Inverno/x.y

      Returns:
      the user agent
    • compression_enabled

      default boolean compression_enabled()

      Enables/Disables HTTP compression.

      Defaults to false.

      Returns:
      true if compression is enabled, false otherwise
    • decompression_enabled

      default boolean decompression_enabled()

      Enables/Disables HTTP decompression.

      Defaults to false.

      Returns:
      true if decompression is enabled, false otherwise
    • compression_contentSizeThreshold

      default int compression_contentSizeThreshold()

      The threshold beyond which the response body should be compressed.

      Defaults to 0 which means all responses are compressed.

      Returns:
      the compression content size threshold
    • compression_brotli_quality

      default int compression_brotli_quality()

      Brotly compression quality.

      Defaults to 4.

      Returns:
      the brotli compression quality
    • compression_brotli_window

      default int compression_brotli_window()

      Brotly compression window.

      Defaults to -1.

      Returns:
      the brotli compression window
    • compression_brotli_mode

      default int compression_brotli_mode()

      Brotly compression mode (0=GENERIC, 1=TEXT, 2=FONT).

      Defaults to 1 (TEXT).

      Returns:
      the brotli compression mode
    • compression_deflate_compressionLevel

      default int compression_deflate_compressionLevel()

      Deflate compression level.

      Defaults to 6.

      Returns:
      the deflate compression level
    • compression_deflate_windowBits

      default int compression_deflate_windowBits()

      Deflate compression window bits.

      Defaults to 15.

      Returns:
      the deflate compression window bits
    • compression_deflate_memLevel

      default int compression_deflate_memLevel()

      Deflate compression memory level.

      Defaults to 8.

      Returns:
      the deflate compression memory level bits
    • compression_gzip_compressionLevel

      default int compression_gzip_compressionLevel()

      Gzip compression level.

      Defaults to 6.

      Returns:
      the gzip compression level
    • compression_gzip_windowBits

      default int compression_gzip_windowBits()

      Gzip compression window bits.

      Defaults to 15.

      Returns:
      the gzip compression window bits
    • compression_gzip_memLevel

      default int compression_gzip_memLevel()

      Gzip compression memory level.

      Defaults to 8.

      Returns:
      the gzip compression memory level
    • compression_zstd_blockSize

      default int compression_zstd_blockSize()

      Zstandard compression block size (in bytes).

      Defaults to 64KB.

      Returns:
      the zstd compression block size
    • compression_zstd_compressionLevel

      default int compression_zstd_compressionLevel()

      Zstandard compression level.

      Defaults to 3.

      Returns:
      the zstd compression level
    • compression_zstd_maxEncodeSize

      default int compression_zstd_maxEncodeSize()

      Zstandard compression max encode size (in bytes).

      Defaults to 32MB.

      Returns:
      the zstd compression max encode size
    • tls_enabled

      default boolean tls_enabled()

      Enables/Disables HTTPS.

      Defaults to false.

      Returns:
      true if the option is enabled, false otherwise
    • tls_key_store

      URI tls_key_store()

      The path to the key store.

      Note that this overrides both tls_trust_manager_factory() and tls_trust_all().

      Returns:
      the key store URI
    • tls_key_store_type

      default String tls_key_store_type()

      The type of key store.

      Defaults to JKS.

      Returns:
      the key store type
    • tls_key_store_password

      String tls_key_store_password()

      The password of the key store.

      Returns:
      a password
    • tls_key_alias

      String tls_key_alias()

      The alias of the key in the key store.

      Returns:
      a key alias
    • tls_key_alias_password

      String tls_key_alias_password()

      The password for the alias of the key in the key store.

      Returns:
      a password
    • tls_trust_store

      URI tls_trust_store()

      The path to the key store.

      Returns:
      the key store URI
    • tls_trust_store_type

      default String tls_trust_store_type()

      The type of key store.

      Defaults to JKS.

      Returns:
      the key store type
    • tls_trust_store_password

      String tls_trust_store_password()

      The password of the key store.

      Returns:
      a password
    • tls_trust_manager_factory

      TrustManagerFactory tls_trust_manager_factory()

      The trust manager factory.

      Note that this overrides tls_trust_all().

      Returns:
      the trust manager factory
    • tls_trust_all

      default boolean tls_trust_all()

      Indicates whether all server certificates should be trusted (including self-signed certificates).

      Note that this overrides tls_trust_manager_factory().

      Defaults to false

      Returns:
      true to trust all server certificates
    • tls_send_sni

      default boolean tls_send_sni()

      Sends Server Name Indication parameter during TLS handshake.

      Defaults to false.

      Returns:
      true if the client must send the hostname to the server during TLS handshake
    • tls_ciphers_includes

      String[] tls_ciphers_includes()

      The list of ciphers to include.

      Returns:
      a list of ciphers
    • tls_ciphers_excludes

      String[] tls_ciphers_excludes()

      The list of ciphers to exclude.

      Returns:
      a list of ciphers
    • http1x_initial_buffer_size

      default int http1x_initial_buffer_size()

      HTTP/1.x initial buffer size in bytes used when parsing the lines of the HTTP headers.

      Defaults to 128.

      Returns:
      the initial buffer size
    • http1x_max_initial_line_length

      default int http1x_max_initial_line_length()

      HTTP/1.x max length in bytes of the first line of the HTTP headers.

      Defaults to 4096.

      Returns:
      the max initial line length
    • http1x_max_chunk_size

      default int http1x_max_chunk_size()

      HTTP/1.x max chunk size in bytes.

      Defaults to 8192.

      Returns:
      the max chunk size
    • http1x_max_header_size

      default int http1x_max_header_size()

      HTTP/1.x max header line size in bytes.

      Defaults to 8192.

      Returns:
      the max header line size
    • http1x_validate_headers

      default boolean http1x_validate_headers()

      Enables/Disables HTTP/1.x header validation.

      It is recommended to always validate headers in order to prevent request/response splitting attack.

      Defaults to true.

      Returns:
      true to validate headers, false otherwise
    • http1_max_concurrent_requests

      default Long http1_max_concurrent_requests()

      The HTTP/1.1 pipelining limit which corresponds to the maximum concurrent requests on a single connection.

      Defaults to 10 (null means no limit).

      Returns:
      the maximum HTTP/1.1 concurrent requests on a single connection
    • http2_header_table_size

      default Long http2_header_table_size()

      The HTTP/2 header table size.

      Defaults to 4096.

      Returns:
      the header table size
    • http2_max_concurrent_streams

      default Long http2_max_concurrent_streams()

      HTTP/2 max concurrent streams.

      Defaults to 100.

      Returns:
      max concurrent streams
    • http2_initial_window_size

      default Integer http2_initial_window_size()

      HTTP/2 initial window size.

      Defaults to 65535.

      Returns:
      initial window size
    • http2_max_frame_size

      default Integer http2_max_frame_size()

      HTTP/2 max frame size.

      Defaults to 16384.

      Returns:
      max frame size
    • http2_max_header_list_size

      default Integer http2_max_header_list_size()

      HTTP/2 max header list size.

      Defaults to Integer.MAX_VALUE.

      Returns:
      max header list size
    • http2_validate_headers

      default boolean http2_validate_headers()

      Enables/Disables HTTP/2.0 header validation as defined by RFC 7540 Section 8.1.2.6.

      Defaults to true.

      Returns:
      true to validate headers, false otherwise
    • ws_max_frame_size

      default Integer ws_max_frame_size()

      WebSocket max frame size in bytes.

      Defaults to 65536.

      Returns:
      the WebSocket max frame size
    • ws_frame_compression_enabled

      default boolean ws_frame_compression_enabled()

      Enables/Disables WebSocket per frame compression.

      Defaults to false.

      Returns:
      true if WebSocket per frame is enabled, false otherwise
    • ws_frame_compression_level

      default int ws_frame_compression_level()

      WebSocket per frame compression level.

      Defaults to 6.

      Returns:
      the WebSocket frame compression level
    • ws_message_compression_enabled

      default boolean ws_message_compression_enabled()

      Enables/Disables WebSocket per message compression.

      Defaults to false.

      Returns:
      true if WebSocket per message is enabled, false otherwise
    • ws_message_compression_level

      default int ws_message_compression_level()

      WebSocket per message compression level.

      Defaults to 6.

      Returns:
      the WebSocket message compression level
    • ws_message_allow_client_window_size

      default boolean ws_message_allow_client_window_size()

      Allows WebSocket server to customize the client inflater window size.

      Defaults to false.

      Returns:
      true to allow WebSocket server to customize the client inflater window size, false otherwise
    • ws_message_requested_server_window_size

      default int ws_message_requested_server_window_size()

      Indicates the requested sever window size to use if server inflater is customizable.

      Defaults to 15.

      Returns:
      the requested sever window size to use if server inflater is customizable
    • ws_message_allow_client_no_context

      default boolean ws_message_allow_client_no_context()

      Allows WebSocket server to activate client_no_context_takeover.

      Defaults to false.

      Returns:
      true to allow WebSocket server to activate client_no_context_takeover, false otherwise
    • ws_message_requested_server_no_context

      default boolean ws_message_requested_server_no_context()

      Indicates whether client needs to activate server_no_context_takeover if server is compatible with.

      Defaults to false

      Returns:
      true to activate server_no_context_takeover if server is compatible with, false otherwise
    • ws_close_on_outbound_complete

      default boolean ws_close_on_outbound_complete()

      Indicates whether a WebSocket should be closed when the outbound frames publisher completes.

      Note that this behaviour can be overridden by invoking BaseWebSocketExchange.Outbound.closeOnComplete(boolean) on the WebSocket exchange's outbound.

      Defaults to false

      Returns:
      true to close the WebSocket when the outbound frames publisher completes, false otherwise.
    • ws_inbound_close_frame_timeout

      default long ws_inbound_close_frame_timeout()

      The time in milliseconds to wait after a close frame has been sent for a close frame to be received before closing the WebSocket unilaterally.

      Defaults to 60000.

      Returns:
      the inbound close frame timeout