WebServer (webserver) Configuration

Type: io.helidon.webserver.WebServer

This is a standalone configuration type, prefix from configuration root: server

Configuration options

Optional configuration options
keytypedefault valuedescription
backlog

int

1024

Accept backlog.

@return backlog
connection-config 

Configuration of a connection (established from client against our server).

@return connection configuration
connection-options 

Options for connections accepted by this listener. This is not used to setup server connection.

@return socket options
content-encoding 

Configure the listener specific io.helidon.http.encoding.ContentEncodingContext. This method discards all previously registered ContentEncodingContext. If no content encoding context is registered, content encoding context of the webserver would be used.

@return content encoding context
features 

Server features allow customization of the server, listeners, or routings.

@return server features
host

string

0.0.0.0

Host of the default socket. Defaults to all host addresses (0.0.0.0).

@return host address to listen on (for the default socket)
idle-connection-period

Duration

PT2M

How often should we check for #idleConnectionTimeout(). Defaults to PT2M (2 minutes).

@return period of checking for idle connections
idle-connection-timeout

Duration

PT5M

How long should we wait before closing a connection that has no traffic on it. Defaults to PT5M (5 minutes). Note that the timestamp is refreshed max. once per second, so this setting would be useless if configured for shorter periods of time (also not a very good support for connection keep alive, if the connections are killed so soon anyway).

@return timeout of idle connections
max-concurrent-requests

int

-1

Limits the number of requests that can be executed at the same time (the number of active virtual threads of requests). Defaults to -1, meaning "unlimited" - what the system allows. Also make sure that this number is higher than the expected time it takes to handle a single request in your application, as otherwise you may stop in-progress requests.

@return number of requests that can be processed on this listener, regardless of protocol
max-in-memory-entity

int

131072

If the entity is expected to be smaller that this number of bytes, it would be buffered in memory to optimize performance when writing it. If bigger, streaming will be used.

Note that for some entity types we cannot use streaming, as they are already fully in memory (String, byte[]), for such
cases, this option is ignored.
Default is 128Kb.
@return maximal number of bytes to buffer in memory for supported writers
max-payload-size

long

-1

Maximal number of bytes an entity may have. If io.helidon.http.HeaderNames#CONTENT_LENGTH is used, this is checked immediately, if io.helidon.http.HeaderValues#TRANSFER_ENCODING_CHUNKED is used, we will fail when the number of bytes read would exceed the max payload size. Defaults to unlimited (-1).

@return maximal number of bytes of entity
max-tcp-connections

int

-1

Limits the number of connections that can be opened at a single point in time. Defaults to -1, meaning "unlimited" - what the system allows.

@return number of TCP connections that can be opened to this listener, regardless of protocol
media-context 

Configure the listener specific io.helidon.http.media.MediaContext. This method discards all previously registered MediaContext. If no media context is registered, media context of the webserver would be used.

@return media context
name

string

@default

Name of this socket. Defaults to @default. Must be defined if more than one socket is needed.

@return name of the socket
port

int

0

Port of the default socket. If configured to 0 (the default), server starts on a random port.

@return port to listen on (for the default socket)
protocols

io.helidon.webserver.spi.ProtocolConfig[] (service provider interface)

 

Configuration of protocols. This may be either protocol selectors, or protocol upgraders from HTTP/1.1. As the order is not important (providers are ordered by weight by default), we can use a configuration as an object, such as: <pre> protocols: providers: http_1_1: max-prologue-length: 8192 http_2: max-frame-size: 4096 websocket: …​. </pre>

@return all defined protocol configurations, loaded from service loader by default
receive-buffer-size

int

 

Listener receive buffer size.

@return buffer size in bytes
shutdown-grace-period

Duration

PT0.5S

Grace period in ISO 8601 duration format to allow running tasks to complete before listener’s shutdown. Default is 500 milliseconds. Configuration file values example: PT0.5S, PT2S.

@return grace period
shutdown-hook

boolean

true

When true the webserver registers a shutdown hook with the JVM Runtime.

Defaults to true. Set this to false such that a shutdown hook is not registered.
@return whether to register a shutdown hook
sockets 

Socket configurations. Note that socket named WebServer#DEFAULT_SOCKET_NAME cannot be used, configure the values on the server directly.

@return map of listener configurations, except for the default one
tls 

Listener TLS configuration.

@return tls of this configuration
write-buffer-size

int

512

Initial buffer size in bytes of java.io.BufferedOutputStream created internally to write data to a socket connection. Default is 512.

@return initial buffer size used for writing
write-queue-length

int

0

Number of buffers queued for write operations.

@return maximal number of queued writes, defaults to 0