public static interface Http2SettingsSpec.Builder
| Modifier and Type | Method and Description |
|---|---|
Http2SettingsSpec |
build()
Build a new
Http2SettingsSpec. |
Http2SettingsSpec.Builder |
connectProtocolEnabled(boolean connectProtocolEnabled)
Sets the
SETTINGS_ENABLE_CONNECT_PROTOCOL value. |
Http2SettingsSpec.Builder |
headerTableSize(long headerTableSize)
Sets the
SETTINGS_HEADER_TABLE_SIZE value. |
Http2SettingsSpec.Builder |
initialWindowSize(int initialWindowSize)
Sets the
SETTINGS_INITIAL_WINDOW_SIZE value. |
Http2SettingsSpec.Builder |
maxConcurrentStreams(long maxConcurrentStreams)
Sets the
SETTINGS_MAX_CONCURRENT_STREAMS value. |
Http2SettingsSpec.Builder |
maxDecodedRstFramesPerWindow(int maxDecodedRstFramesPerWindow,
int maxDecodedRstFramesSecondsPerWindow)
Sets the maximum number RST frames that are allowed per window before the connection is closed.
|
Http2SettingsSpec.Builder |
maxEncodedRstFramesPerWindow(int maxEncodedRstFramesPerWindow,
int maxEncodedRstFramesSecondsPerWindow)
Sets the maximum number RST frames that are allowed per window before the connection is closed.
|
Http2SettingsSpec.Builder |
maxFrameSize(int maxFrameSize)
Sets the
SETTINGS_MAX_FRAME_SIZE value. |
Http2SettingsSpec.Builder |
maxHeaderListSize(long maxHeaderListSize)
Sets the
SETTINGS_MAX_HEADER_LIST_SIZE value. |
Http2SettingsSpec.Builder |
maxStreams(long maxStreams)
The connection is marked for closing once the number of all-time streams reaches
maxStreams. |
default Http2SettingsSpec.Builder |
pingAckDropThreshold(int pingAckDropThreshold)
Sets the maximum number of PING frame transmission attempts before closing the connection.
|
default Http2SettingsSpec.Builder |
pingAckTimeout(Duration pingAckTimeout)
Sets the timeout for receiving an ACK response to HTTP/2 PING frames.
|
Http2SettingsSpec build()
Http2SettingsSpec.Http2SettingsSpecHttp2SettingsSpec.Builder connectProtocolEnabled(boolean connectProtocolEnabled)
SETTINGS_ENABLE_CONNECT_PROTOCOL value.connectProtocolEnabled - the SETTINGS_ENABLE_CONNECT_PROTOCOL valuethisHttp2SettingsSpec.Builder headerTableSize(long headerTableSize)
SETTINGS_HEADER_TABLE_SIZE value.headerTableSize - the SETTINGS_HEADER_TABLE_SIZE valuethisHttp2SettingsSpec.Builder initialWindowSize(int initialWindowSize)
SETTINGS_INITIAL_WINDOW_SIZE value.initialWindowSize - the SETTINGS_INITIAL_WINDOW_SIZE valuethisHttp2SettingsSpec.Builder maxConcurrentStreams(long maxConcurrentStreams)
SETTINGS_MAX_CONCURRENT_STREAMS value.maxConcurrentStreams - the SETTINGS_MAX_CONCURRENT_STREAMS valuethisHttp2SettingsSpec.Builder maxDecodedRstFramesPerWindow(int maxDecodedRstFramesPerWindow, int maxDecodedRstFramesSecondsPerWindow)
0 for any of the parameters means no protection should be applied.
For server, the default {code maxDecodedRstFramesPerWindow} is 200 and for the client it is 0.
The default {code maxDecodedRstFramesSecondsPerWindow} is 30.maxDecodedRstFramesPerWindow - the maximum number RST frames that are allowed per windowmaxDecodedRstFramesSecondsPerWindow - the maximum seconds per windowthisHttp2SettingsSpec.Builder maxEncodedRstFramesPerWindow(int maxEncodedRstFramesPerWindow, int maxEncodedRstFramesSecondsPerWindow)
0 for any of the parameters means no protection should be applied.
For server, the default {code maxEncodedRstFramesPerWindow} is 200 and for the client it is 0.
The default {code maxEncodedRstFramesSecondsPerWindow} is 30.maxEncodedRstFramesPerWindow - the maximum number RST frames that are allowed per windowmaxEncodedRstFramesSecondsPerWindow - the maximum seconds per windowthisHttp2SettingsSpec.Builder maxFrameSize(int maxFrameSize)
SETTINGS_MAX_FRAME_SIZE value.maxFrameSize - the SETTINGS_MAX_FRAME_SIZE valuethisHttp2SettingsSpec.Builder maxHeaderListSize(long maxHeaderListSize)
SETTINGS_MAX_HEADER_LIST_SIZE value.maxHeaderListSize - the SETTINGS_MAX_HEADER_LIST_SIZE valuethisHttp2SettingsSpec.Builder maxStreams(long maxStreams)
maxStreams.thisdefault Http2SettingsSpec.Builder pingAckDropThreshold(int pingAckDropThreshold)
This method configures how many PING frames will be sent without receiving an ACK
before considering the connection as unresponsive and closing it.
Each PING waits for pingAckTimeout(Duration) before either receiving an ACK
(which resets the health check) or timing out and sending the next PING.
Example with pingAckDropThreshold=1:
pingAckTimeout for ACK
Example with pingAckDropThreshold=2:
pingAckTimeout for ACKpingAckTimeout for ACKA lower threshold detects connection failures more quickly but may lead to premature disconnections if network latency is high. A higher threshold tolerates more packet loss or delays but increases the time to detect truly dead connections.
The default pingAckDropThreshold is 1, meaning only one PING frame
will be sent. If no ACK is received within pingAckTimeout, the connection closes immediately.
pingAckDropThreshold - the maximum number of PING transmission attempts without receiving ACK.
Must be a positive integer (minimum 1). Default is 1.thisdefault Http2SettingsSpec.Builder pingAckTimeout(Duration pingAckTimeout)
This method configures how long to wait for a PING ACK response before
either retrying or closing the connection (based on pingAckDropThreshold(int)).
This timeout is used in conjunction with the idle timeout to detect unresponsive connections.
When a connection becomes idle (no reads/writes for the configured idle timeout duration),
a PING frame is sent to check if the peer is still responsive. If no ACK is received
within the pingAckTimeout duration, another PING attempt may be made
(depending on pingAckDropThreshold). If all attempts fail, the connection is closed.
Important: This setting only takes effect when used together with:
ConnectionProvider with maxIdleTime configuredHttpServer with idleTimeout configuredThe timeout should be chosen based on your network conditions and requirements:
pingAckTimeout - the timeout duration to wait for a PING ACK response.
Must be a positive value.this