Class NettyHttpServerConfiguration
- All Implemented Interfaces:
ServerContextPathProvider
NettyHttpServer.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAccess logger configuration.static classAbstract class for configuring the Netty event loop.static classDeprecated, for removal: This API element is subject to removal in a future version.static classHttp2 settings.static final classConfiguration for the experimental HTTP/3 server.static enumSets the manner in which the HTTP server is configured to receive requests.static final classNetty listener configuration.static classConfiguration for Netty parent.static classConfiguration for Netty worker.Nested classes/interfaces inherited from class io.micronaut.http.server.HttpServerConfiguration
HttpServerConfiguration.CorsConfiguration, HttpServerConfiguration.HostResolutionConfiguration, HttpServerConfiguration.HttpLocaleResolutionConfigurationProperties, HttpServerConfiguration.MultipartConfiguration -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanThe default chunk supported value.static final intThe default compression level.static final intThe default compression threshold.static final booleanThe default value for eager parsing.static final intDefault value forformMaxBufferedBytes.static final intDefault value forformMaxFields.static final intDefault value forNettyHttpServerConfiguration.Http3Settings.getInitialMaxData().static final intstatic final intstatic final intstatic final intThe default initial buffer size value.static final intThe default value for eager parsing.static final booleanThe default configuration for boolean flag indicating whether to add connection header `keep-alive` to responses with HttpStatus > 499.static final intThe default size of the largest data that can be encoded using the zstd algorithm.static final intThe default max chunk size.static final intThe default max header size.static final intThe default max initial line length.static final booleanThe default use netty's native transport flag.static final booleanThe default validate headers value.Fields inherited from class io.micronaut.http.server.HttpServerConfiguration
DEFAULT_DATEHEADER, DEFAULT_DISPATCH_OPTIONS_REQUESTS, DEFAULT_DUAL_PROTOCOL, DEFAULT_HTTP_TO_HTTPS_REDIRECT, DEFAULT_IDLE_TIME_MINUTES, DEFAULT_LOG_HANDLED_EXCEPTIONS, DEFAULT_MAX_PARAMS, DEFAULT_MAX_REQUEST_BUFFER_SIZE, DEFAULT_MAX_REQUEST_SIZE, DEFAULT_PORT, DEFAULT_RANDOM_PORT, DEFAULT_READ_IDLE_TIME_MINUTES, DEFAULT_SEMICOLON_IS_NORMAL_CHAR, DEFAULT_WRITE_IDLE_TIME_MINUTES, PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionDefault empty constructor.NettyHttpServerConfiguration(ApplicationConfiguration applicationConfiguration) NettyHttpServerConfiguration(ApplicationConfiguration applicationConfiguration, List<ChannelPipelineListener> pipelineCustomizers) -
Method Summary
Modifier and TypeMethodDescriptionReturns the AccessLogger configuration.intThe default compression level.intThe default compression threshold.intThe maximum number of bytes the form / multipart decoders are allowed to buffer internally.intThe maximum number of form fields permitted in a request.getHttp2()Returns the Http2Settings.getHttp3()Returns the Http3Settings.intThe initial buffer size.intMaximum number of buffers to keep around in JSON parsing before they should be consolidated.Get the explicit netty listener configurations, ornullif they should be implicit.Optional<io.netty.handler.logging.LogLevel>The serverLogLevelto enable.intThe maximum chunk size.intThe maximum size of the body of the HTTP1.1 request used to upgrade a connection to HTTP2 clear-text (h2c).intThe maximum size of an individual HTTP setter.intThe maximum length of the initial HTTP request line.intThe default maximum size of data that can be encoded using the zstd algorithm.The path pattern to use for logging incoming connections to pcap.booleanWhether chunked requests are supported.booleanIf a 100-continue response is detected but the content length is too large then true means close the connection.booleanParse incoming JSON data eagerly, before route binding.booleanbooleanPrior to 4.4.0, the Micronaut HTTP server used a multi-pipeline approach for handling HTTP/2 connections where every request got its own netty pipeline with HTTP/2 to HTTP/1.1 converters on the pipeline.booleanWhether to use netty's native transport (epoll or kqueue) if available.booleanWhether to validate headers.voidsetAccessLogger(NettyHttpServerConfiguration.AccessLogger accessLogger) Sets the AccessLogger configuration.voidsetChildOptions(Map<io.netty.channel.ChannelOption, Object> childOptions) Sets the Netty child worker options.voidsetChunkedSupported(boolean chunkedSupported) Sets whether chunked transfer encoding is supported.voidsetCloseOnExpectationFailed(boolean closeOnExpectationFailed) If a 100-continue response is detected but the content length is too large then true means close the connection.voidsetCompressionLevel(int compressionLevel) Sets the compression level (0-9).voidsetCompressionThreshold(int compressionThreshold) Sets the minimum size of a request body must be in order to be compressed.voidsetEagerParsing(boolean eagerParsing) Parse incoming JSON data eagerly, before route binding.voidsetFallbackProtocol(String fallbackProtocol) Sets the fallback protocol to use when negotiating via ALPN.voidsetFileTypeHandlerConfiguration(@NonNull NettyHttpServerConfiguration.FileTypeHandlerConfiguration fileTypeHandlerConfiguration) Sets the file type handler configuration.voidsetFormMaxBufferedBytes(int formMaxBufferedBytes) The maximum number of bytes the form / multipart decoders are allowed to buffer internally.voidsetFormMaxFields(int formMaxFields) The maximum number of form fields permitted in a request.voidSets the Http2Settings.voidsetHttp3Settings(NettyHttpServerConfiguration.Http3Settings http3Settings) Sets the Http3Settings.voidsetInitialBufferSize(int initialBufferSize) Sets the initial buffer size.voidsetJsonBufferMaxComponents(int jsonBufferMaxComponents) Maximum number of buffers to keep around in JSON parsing before they should be consolidated.voidsetKeepAliveOnServerError(boolean keepAliveOnServerError) Whether to send connection keep alive on internal server errors.voidsetLegacyMultiplexHandlers(boolean legacyMultiplexHandlers) Prior to 4.4.0, the Micronaut HTTP server used a multi-pipeline approach for handling HTTP/2 connections where every request got its own netty pipeline with HTTP/2 to HTTP/1.1 converters on the pipeline.voidSet the explicit netty listener configurations, ornullif they should be implicit.voidsetLogLevel(io.netty.handler.logging.LogLevel logLevel) Sets the Netty log level.voidsetMaxChunkSize(int maxChunkSize) Sets the maximum size of any single request chunk.voidsetMaxH2cUpgradeRequestSize(int maxH2cUpgradeRequestSize) Sets the maximum size of the body of the HTTP1.1 request used to upgrade a connection to HTTP2 clear-text (h2c).voidsetMaxHeaderSize(int maxHeaderSize) Sets the maximum size of any one header.voidsetMaxInitialLineLength(int maxInitialLineLength) Sets the maximum initial line length for the HTTP request.voidsetMaxZstdEncodeSize(int maxZstdEncodeSize) Sets the maximum size of data that can be encoded using the zstd algorithm.voidsetOptions(Map<io.netty.channel.ChannelOption, Object> options) Sets the channel options.voidSets the parent event loop configuration.voidsetPcapLoggingPathPattern(String pcapLoggingPathPattern) The path pattern to use for logging incoming connections to pcap.voidSet the server type.voidsetUseNativeTransport(boolean useNativeTransport) Sets whether to use netty's native transport (epoll or kqueue) if available .voidsetValidateHeaders(boolean validateHeaders) Sets whether to validate incoming headers.voidSets the worker event loop configuration.Methods inherited from class io.micronaut.http.server.HttpServerConfiguration
getApplicationConfiguration, getClientAddressHeader, getContextPath, getCors, getDefaultCharset, getHost, getHostResolution, getHttpVersion, getIdleTimeout, getLocaleResolution, getMaxParams, getMaxRequestBufferSize, getMaxRequestSize, getMultipart, getPort, getReadIdleTimeout, getReadTimeout, getServerHeader, getThreadSelection, getWriteIdleTimeout, isDateHeader, isDispatchOptionsRequests, isDualProtocol, isEscapeHtmlUrl, isHttpToHttpsRedirect, isLogHandledExceptions, isNotFoundOnMissingBody, isSemicolonIsNormalChar, isValidateUrl, setClientAddressHeader, setContextPath, setCors, setDateHeader, setDefaultCharset, setDispatchOptionsRequests, setDualProtocol, setEscapeHtmlUrl, setHost, setHostResolution, setHttpToHttpsRedirect, setHttpVersion, setIdleTimeout, setLocaleResolution, setLogHandledExceptions, setMaxParams, setMaxRequestBufferSize, setMaxRequestSize, setMultipart, setNotFoundOnMissingBody, setPort, setReadIdleTimeout, setReadTimeout, setSemicolonIsNormalChar, setServerHeader, setThreadSelection, setValidateUrl, setWriteIdleTimeout
-
Field Details
-
DEFAULT_USE_NATIVE_TRANSPORT
public static final boolean DEFAULT_USE_NATIVE_TRANSPORTThe default use netty's native transport flag.- See Also:
-
DEFAULT_MAXINITIALLINELENGTH
public static final int DEFAULT_MAXINITIALLINELENGTHThe default max initial line length.- See Also:
-
DEFAULT_MAXHEADERSIZE
public static final int DEFAULT_MAXHEADERSIZEThe default max header size.- See Also:
-
DEFAULT_MAXCHUNKSIZE
public static final int DEFAULT_MAXCHUNKSIZEThe default max chunk size.- See Also:
-
DEFAULT_CHUNKSUPPORTED
public static final boolean DEFAULT_CHUNKSUPPORTEDThe default chunk supported value.- See Also:
-
DEFAULT_VALIDATEHEADERS
public static final boolean DEFAULT_VALIDATEHEADERSThe default validate headers value.- See Also:
-
DEFAULT_INITIALBUFFERSIZE
public static final int DEFAULT_INITIALBUFFERSIZEThe default initial buffer size value.- See Also:
-
DEFAULT_COMPRESSIONTHRESHOLD
public static final int DEFAULT_COMPRESSIONTHRESHOLDThe default compression threshold.- See Also:
-
DEFAULT_COMPRESSIONLEVEL
public static final int DEFAULT_COMPRESSIONLEVELThe default compression level.- See Also:
-
DEFAULT_MAX_ZSTD_ENCODE_SIZE
public static final int DEFAULT_MAX_ZSTD_ENCODE_SIZEThe default size of the largest data that can be encoded using the zstd algorithm.- See Also:
-
DEFAULT_KEEP_ALIVE_ON_SERVER_ERROR
public static final boolean DEFAULT_KEEP_ALIVE_ON_SERVER_ERRORThe default configuration for boolean flag indicating whether to add connection header `keep-alive` to responses with HttpStatus > 499.- See Also:
-
DEFAULT_EAGER_PARSING
public static final boolean DEFAULT_EAGER_PARSINGThe default value for eager parsing.- Since:
- 4.0.0
- See Also:
-
DEFAULT_JSON_BUFFER_MAX_COMPONENTS
public static final int DEFAULT_JSON_BUFFER_MAX_COMPONENTSThe default value for eager parsing.- Since:
- 4.0.0
- See Also:
-
DEFAULT_HTTP3_INITIAL_MAX_DATA
public static final int DEFAULT_HTTP3_INITIAL_MAX_DATADefault value forNettyHttpServerConfiguration.Http3Settings.getInitialMaxData().- Since:
- 4.0.0
- See Also:
-
DEFAULT_HTTP3_INITIAL_MAX_STREAM_DATA_BIDIRECTIONAL_LOCAL
public static final int DEFAULT_HTTP3_INITIAL_MAX_STREAM_DATA_BIDIRECTIONAL_LOCALDefault value forNettyHttpServerConfiguration.Http3Settings.getInitialMaxStreamDataBidirectionalLocal().- Since:
- 4.0.0
- See Also:
-
DEFAULT_HTTP3_INITIAL_MAX_STREAM_DATA_BIDIRECTIONAL_REMOTE
public static final int DEFAULT_HTTP3_INITIAL_MAX_STREAM_DATA_BIDIRECTIONAL_REMOTEDefault value forNettyHttpServerConfiguration.Http3Settings.getInitialMaxStreamDataBidirectionalRemote().- Since:
- 4.0.0
- See Also:
-
DEFAULT_HTTP3_INITIAL_MAX_STREAMS_BIDIRECTIONAL
public static final int DEFAULT_HTTP3_INITIAL_MAX_STREAMS_BIDIRECTIONAL- Since:
- 4.0.0
- See Also:
-
DEFAULT_FORM_MAX_FIELDS
public static final int DEFAULT_FORM_MAX_FIELDSDefault value forformMaxFields.- Since:
- 4.6.0
- See Also:
-
DEFAULT_FORM_MAX_BUFFERED_BYTES
public static final int DEFAULT_FORM_MAX_BUFFERED_BYTESDefault value forformMaxBufferedBytes.- Since:
- 4.6.0
- See Also:
-
-
Constructor Details
-
NettyHttpServerConfiguration
public NettyHttpServerConfiguration()Default empty constructor. -
NettyHttpServerConfiguration
- Parameters:
applicationConfiguration- The application configuration
-
NettyHttpServerConfiguration
@Inject public NettyHttpServerConfiguration(ApplicationConfiguration applicationConfiguration, List<ChannelPipelineListener> pipelineCustomizers) - Parameters:
applicationConfiguration- The application configurationpipelineCustomizers- A list of pipeline customizers
-
-
Method Details
-
getServerType
- Returns:
- Sets the server type.
- See Also:
-
isCloseOnExpectationFailed
public boolean isCloseOnExpectationFailed()If a 100-continue response is detected but the content length is too large then true means close the connection. otherwise the connection will remain open and data will be consumed and discarded until the next request is received.only relevant when
NettyHttpServerConfiguration.HttpServerType.FULL_CONTENTis set- Returns:
- True if the connection should be closed
- See Also:
-
setServerType(HttpServerType)HttpObjectAggregator
-
setCloseOnExpectationFailed
public void setCloseOnExpectationFailed(boolean closeOnExpectationFailed) If a 100-continue response is detected but the content length is too large then true means close the connection. otherwise the connection will remain open and data will be consumed and discarded until the next request is received.only relevant when
NettyHttpServerConfiguration.HttpServerType.FULL_CONTENTis set- Parameters:
closeOnExpectationFailed- True if the connection should be closed- See Also:
-
setServerType(HttpServerType)HttpObjectAggregator
-
setServerType
public void setServerType(@Nullable @Nullable NettyHttpServerConfiguration.HttpServerType serverType) Set the server type.- Parameters:
serverType- The server type
-
getAccessLogger
Returns the AccessLogger configuration.- Returns:
- The AccessLogger configuration.
-
setAccessLogger
Sets the AccessLogger configuration.- Parameters:
accessLogger- The configuration .
-
getHttp2
Returns the Http2Settings.- Returns:
- The Http2Settings.
-
setHttp2
Sets the Http2Settings.- Parameters:
http2- The Http2Settings.
-
getHttp3
Returns the Http3Settings.- Returns:
- The Http3Settings.
-
setHttp3Settings
Sets the Http3Settings.- Parameters:
http3Settings- The Http3Settings.
-
getPipelineCustomizers
- Returns:
- The pipeline customizers
-
getFallbackProtocol
- Returns:
- The fallback protocol to use when negotiating via ALPN
- See Also:
-
ApplicationProtocolNames
-
setFallbackProtocol
Sets the fallback protocol to use when negotiating via ALPN.- Parameters:
fallbackProtocol- The fallback protocol to use when negotiating via ALPN- See Also:
-
ApplicationProtocolNames
-
getLogLevel
The serverLogLevelto enable.- Returns:
- The server
LogLevelto enable
-
getMaxInitialLineLength
public int getMaxInitialLineLength()The maximum length of the initial HTTP request line. Defaults to 4096.- Returns:
- The maximum length of the initial HTTP request line
-
getMaxHeaderSize
public int getMaxHeaderSize()The maximum size of an individual HTTP setter. Defaults to 8192.- Returns:
- The maximum size of an individual HTTP setter
-
getMaxChunkSize
public int getMaxChunkSize()The maximum chunk size. Defaults to 8192.- Returns:
- The maximum chunk size
-
getMaxH2cUpgradeRequestSize
public int getMaxH2cUpgradeRequestSize()The maximum size of the body of the HTTP1.1 request used to upgrade a connection to HTTP2 clear-text (h2c). This initial request cannot be streamed and is instead buffered in full, so the default value (8192) is relatively small. If this value is too small for your use case, instead consider using an empty initial "upgrade request" (e.g.OPTIONS /), or switch to normal HTTP2.Does not affect normal HTTP2 (TLS).
- Returns:
- The maximum content length of the request.
-
isChunkedSupported
public boolean isChunkedSupported()Whether chunked requests are supported.- Returns:
- Whether chunked requests are supported.
-
isUseNativeTransport
public boolean isUseNativeTransport()Whether to use netty's native transport (epoll or kqueue) if available.- Returns:
- To use netty's native transport (epoll or kqueue) if available.
-
isValidateHeaders
public boolean isValidateHeaders()Whether to validate headers.- Returns:
- Whether to validate headers
-
getInitialBufferSize
public int getInitialBufferSize()The initial buffer size. Defaults to 128.- Returns:
- The initial buffer size.
-
getCompressionThreshold
public int getCompressionThreshold()The default compression threshold. Defaults to 1024.A value
< 0indicates compression should never be enabled.- Returns:
- The compression threshold.
-
getCompressionLevel
public int getCompressionLevel()The default compression level. Default value (6).- Returns:
- The compression level.
-
getMaxZstdEncodeSize
public int getMaxZstdEncodeSize()The default maximum size of data that can be encoded using the zstd algorithm. Default value (33554432).- Returns:
- The maximum size of data that can be encoded using the zstd algorithm.
-
getChildOptions
- Returns:
- The Netty child channel options.
- See Also:
-
ServerBootstrap.childOption(io.netty.channel.ChannelOption, Object)
-
getOptions
- Returns:
- The Netty channel options.
- See Also:
-
ServerBootstrap.childOption(io.netty.channel.ChannelOption, Object)
-
getWorker
- Returns:
- Configuration for the worker
EventLoopGroup
-
getFileTypeHandlerConfiguration
@NonNull public @NonNull NettyHttpServerConfiguration.FileTypeHandlerConfiguration getFileTypeHandlerConfiguration()- Returns:
- The file type handler configuration.
- Since:
- 3.1.0
-
setFileTypeHandlerConfiguration
@Inject public void setFileTypeHandlerConfiguration(@NonNull @NonNull NettyHttpServerConfiguration.FileTypeHandlerConfiguration fileTypeHandlerConfiguration) Sets the file type handler configuration.- Parameters:
fileTypeHandlerConfiguration- The file type handler configuration- Since:
- 3.1.0
-
getParent
- Returns:
- Configuration for the parent
EventLoopGroup
-
isKeepAliveOnServerError
public boolean isKeepAliveOnServerError()- Returns:
- True if the connection should be kept alive on internal server errors
-
setChildOptions
Sets the Netty child worker options.- Parameters:
childOptions- The options
-
setOptions
Sets the channel options.- Parameters:
options- The channel options
-
setWorker
Sets the worker event loop configuration.- Parameters:
worker- The worker config
-
setParent
Sets the parent event loop configuration.- Parameters:
parent- The parent config
-
setMaxInitialLineLength
Sets the maximum initial line length for the HTTP request. Default value (4096).- Parameters:
maxInitialLineLength- The max length
-
setMaxHeaderSize
Sets the maximum size of any one header. Default value (8192).- Parameters:
maxHeaderSize- The max header size
-
setMaxChunkSize
Sets the maximum size of any single request chunk. Default value (8192).- Parameters:
maxChunkSize- The max chunk size
-
setMaxH2cUpgradeRequestSize
public void setMaxH2cUpgradeRequestSize(int maxH2cUpgradeRequestSize) Sets the maximum size of the body of the HTTP1.1 request used to upgrade a connection to HTTP2 clear-text (h2c). This initial request cannot be streamed and is instead buffered in full, so the default value (8192) is relatively small. If this value is too small for your use case, instead consider using an empty initial "upgrade request" (e.g.OPTIONS /), or switch to normal HTTP2.Does not affect normal HTTP2 (TLS).
- Parameters:
maxH2cUpgradeRequestSize- The maximum content length of the request.
-
setChunkedSupported
public void setChunkedSupported(boolean chunkedSupported) Sets whether chunked transfer encoding is supported. Default value (true).- Parameters:
chunkedSupported- True if it is supported
-
setUseNativeTransport
public void setUseNativeTransport(boolean useNativeTransport) Sets whether to use netty's native transport (epoll or kqueue) if available . Default value (false).- Parameters:
useNativeTransport- True if netty's native transport should be use if available.
-
setValidateHeaders
public void setValidateHeaders(boolean validateHeaders) Sets whether to validate incoming headers. Default value (true).- Parameters:
validateHeaders- True if headers should be validated.
-
setInitialBufferSize
public void setInitialBufferSize(int initialBufferSize) Sets the initial buffer size. Default value (128).- Parameters:
initialBufferSize- The initial buffer size
-
setLogLevel
public void setLogLevel(io.netty.handler.logging.LogLevel logLevel) Sets the Netty log level.- Parameters:
logLevel- The log level
-
setCompressionThreshold
Sets the minimum size of a request body must be in order to be compressed. Default value (1024).- Parameters:
compressionThreshold- The size request bodies must be in order to be a candidate for compression.
-
setCompressionLevel
Sets the compression level (0-9). Default value (6).- Parameters:
compressionLevel- The compression level.
-
setMaxZstdEncodeSize
public void setMaxZstdEncodeSize(int maxZstdEncodeSize) Sets the maximum size of data that can be encoded using the zstd algorithm. Default value (33554432).- Parameters:
maxZstdEncodeSize- The maximum size of block.
-
setKeepAliveOnServerError
public void setKeepAliveOnServerError(boolean keepAliveOnServerError) Whether to send connection keep alive on internal server errors. Default value (true).- Parameters:
keepAliveOnServerError- The keep alive on server error flag
-
getPcapLoggingPathPattern
The path pattern to use for logging incoming connections to pcap. This is an unsupported option: Behavior may change, or it may disappear entirely, without notice!- Returns:
- The path pattern, or
nullif logging is disabled.
-
setPcapLoggingPathPattern
The path pattern to use for logging incoming connections to pcap. This is an unsupported option: Behavior may change, or it may disappear entirely, without notice!- Parameters:
pcapLoggingPathPattern- The path pattern, ornullto disable logging.
-
getListeners
Get the explicit netty listener configurations, ornullif they should be implicit.- Returns:
- The listeners
-
setListeners
Set the explicit netty listener configurations, ornullif they should be implicit.- Parameters:
listeners- The listeners
-
isEagerParsing
public boolean isEagerParsing()Parse incoming JSON data eagerly, before route binding. Default value false.- Returns:
- Whether to parse incoming JSON data eagerly before route binding
- Since:
- 4.0.0
-
setEagerParsing
public void setEagerParsing(boolean eagerParsing) Parse incoming JSON data eagerly, before route binding. Default value false.- Parameters:
eagerParsing- Whether to parse incoming JSON data eagerly before route binding- Since:
- 4.0.0
-
getJsonBufferMaxComponents
public int getJsonBufferMaxComponents()Maximum number of buffers to keep around in JSON parsing before they should be consolidated. Defaults to 4096.- Returns:
- The maximum number of components
- Since:
- 4.0.0
-
setJsonBufferMaxComponents
public void setJsonBufferMaxComponents(int jsonBufferMaxComponents) Maximum number of buffers to keep around in JSON parsing before they should be consolidated. Defaults to 4096.- Parameters:
jsonBufferMaxComponents- The maximum number of components- Since:
- 4.0.0
-
isLegacyMultiplexHandlers
public boolean isLegacyMultiplexHandlers()Prior to 4.4.0, the Micronaut HTTP server used a multi-pipeline approach for handling HTTP/2 connections where every request got its own netty pipeline with HTTP/2 to HTTP/1.1 converters on the pipeline. This allowed for using mostly unchanged HTTP/1.1 in the request handling and anyNettyServerCustomizers.As of 4.4.0, this approach was replaced with a more performant HTTP/2-specific implementation. This means worse compatibility with HTTP/1.1-based code paths and customizers, however. Setting this option to
truereturns to the old behavior.- Returns:
- Whether to enable the legacy multi-pipeline multiplex handlers for HTTP/2 connections
-
setLegacyMultiplexHandlers
public void setLegacyMultiplexHandlers(boolean legacyMultiplexHandlers) Prior to 4.4.0, the Micronaut HTTP server used a multi-pipeline approach for handling HTTP/2 connections where every request got its own netty pipeline with HTTP/2 to HTTP/1.1 converters on the pipeline. This allowed for using mostly unchanged HTTP/1.1 in the request handling and anyNettyServerCustomizers.As of 4.4.0, this approach was replaced with a more performant HTTP/2-specific implementation. This means worse compatibility with HTTP/1.1-based code paths and customizers, however. Setting this option to
truereturns to the old behavior.- Parameters:
legacyMultiplexHandlers- Whether to enable the legacy multi-pipeline multiplex handlers for HTTP/2 connections
-
getFormMaxFields
public int getFormMaxFields()The maximum number of form fields permitted in a request.- Returns:
- The maximum number of form fields
- Since:
- 4.6.0
-
setFormMaxFields
public void setFormMaxFields(int formMaxFields) The maximum number of form fields permitted in a request.- Parameters:
formMaxFields- The maximum number of form fields- Since:
- 4.6.0
-
getFormMaxBufferedBytes
public int getFormMaxBufferedBytes()The maximum number of bytes the form / multipart decoders are allowed to buffer internally. This sets a limit on form field size.- Returns:
- The maximum number of buffered bytes
- Since:
- 4.6.0
-
setFormMaxBufferedBytes
public void setFormMaxBufferedBytes(int formMaxBufferedBytes) The maximum number of bytes the form / multipart decoders are allowed to buffer internally. This sets a limit on form field size.- Parameters:
formMaxBufferedBytes- The maximum number of buffered bytes- Since:
- 4.6.0
-
HttpServerConfiguration.FileTypeHandlerConfiguration