@ConfigurationProperties(value="netty") @Replaces(value=HttpServerConfiguration.class) public class NettyHttpServerConfiguration extends HttpServerConfiguration
NettyHttpServer
.Modifier and Type | Class and Description |
---|---|
static class |
NettyHttpServerConfiguration.AccessLogger
Access logger configuration.
|
static class |
NettyHttpServerConfiguration.EventLoopConfig
Abstract class for configuring the Netty event loop.
|
static class |
NettyHttpServerConfiguration.FileTypeHandlerConfiguration
Allows configuration of properties for the
FileTypeHandler . |
static class |
NettyHttpServerConfiguration.Http2Settings
Http2 settings.
|
static class |
NettyHttpServerConfiguration.NettyListenerConfiguration
Netty listener configuration.
|
static class |
NettyHttpServerConfiguration.Parent
Configuration for Netty parent.
|
static class |
NettyHttpServerConfiguration.Worker
Configuration for Netty worker.
|
HttpServerConfiguration.CorsConfiguration, HttpServerConfiguration.HostResolutionConfiguration, HttpServerConfiguration.HttpLocaleResolutionConfigurationProperties, HttpServerConfiguration.MultipartConfiguration
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_CHUNKSUPPORTED
The default chunk supported value.
|
static int |
DEFAULT_COMPRESSIONLEVEL
The default compression level.
|
static int |
DEFAULT_COMPRESSIONTHRESHOLD
The default compression threshold.
|
static int |
DEFAULT_INITIALBUFFERSIZE
The default initial buffer size value.
|
static boolean |
DEFAULT_KEEP_ALIVE_ON_SERVER_ERROR
The default configuration for boolean flag indicating whether to add connection header `keep-alive` to responses with HttpStatus > 499.
|
static int |
DEFAULT_MAXCHUNKSIZE
The default max chunk size.
|
static int |
DEFAULT_MAXHEADERSIZE
The default max header size.
|
static int |
DEFAULT_MAXINITIALLINELENGTH
The default max initial line length.
|
static boolean |
DEFAULT_USE_NATIVE_TRANSPORT
The default use netty's native transport flag.
|
static boolean |
DEFAULT_VALIDATEHEADERS
The default validate headers value.
|
DEFAULT_DATEHEADER, DEFAULT_DUAL_PROTOCOL, DEFAULT_HTTP_TO_HTTPS_REDIRECT, DEFAULT_IDLE_TIME_MINUTES, DEFAULT_LOG_HANDLED_EXCEPTIONS, DEFAULT_MAX_REQUEST_SIZE, DEFAULT_PORT, DEFAULT_RANDOM_PORT, DEFAULT_READ_IDLE_TIME_MINUTES, DEFAULT_WRITE_IDLE_TIME_MINUTES, PREFIX
Constructor and Description |
---|
NettyHttpServerConfiguration()
Default empty constructor.
|
NettyHttpServerConfiguration(ApplicationConfiguration applicationConfiguration) |
NettyHttpServerConfiguration(ApplicationConfiguration applicationConfiguration,
List<ChannelPipelineListener> pipelineCustomizers) |
Modifier and Type | Method and Description |
---|---|
NettyHttpServerConfiguration.AccessLogger |
getAccessLogger()
Returns the AccessLogger configuration.
|
Map<io.netty.channel.ChannelOption,Object> |
getChildOptions() |
int |
getCompressionLevel()
The default compression level.
|
int |
getCompressionThreshold()
The default compression threshold.
|
String |
getFallbackProtocol() |
NettyHttpServerConfiguration.FileTypeHandlerConfiguration |
getFileTypeHandlerConfiguration() |
NettyHttpServerConfiguration.Http2Settings |
getHttp2()
Returns the Http2Settings.
|
int |
getInitialBufferSize()
The initial buffer size.
|
List<NettyHttpServerConfiguration.NettyListenerConfiguration> |
getListeners()
Get the explicit netty listener configurations, or
null if they should be implicit. |
Optional<io.netty.handler.logging.LogLevel> |
getLogLevel()
The server
LogLevel to enable. |
int |
getMaxChunkSize()
The maximum chunk size.
|
int |
getMaxH2cUpgradeRequestSize()
The maximum size of the body of the HTTP1.1 request used to upgrade a connection to HTTP2 clear-text (h2c).
|
int |
getMaxHeaderSize()
The maximum size of an individual HTTP setter.
|
int |
getMaxInitialLineLength()
The maximum length of the initial HTTP request line.
|
Map<io.netty.channel.ChannelOption,Object> |
getOptions() |
NettyHttpServerConfiguration.Parent |
getParent() |
String |
getPcapLoggingPathPattern()
The path pattern to use for logging incoming connections to pcap.
|
List<ChannelPipelineListener> |
getPipelineCustomizers() |
NettyHttpServerConfiguration.Worker |
getWorker() |
boolean |
isChunkedSupported()
Whether chunked requests are supported.
|
boolean |
isKeepAliveOnServerError() |
boolean |
isUseNativeTransport()
Whether to use netty's native transport (epoll or kqueue) if available.
|
boolean |
isValidateHeaders()
Whether to validate headers.
|
void |
setAccessLogger(NettyHttpServerConfiguration.AccessLogger accessLogger)
Sets the AccessLogger configuration.
|
void |
setChildOptions(Map<io.netty.channel.ChannelOption,Object> childOptions)
Sets the Netty child worker options.
|
void |
setChunkedSupported(boolean chunkedSupported)
Sets whether chunked transfer encoding is supported.
|
void |
setCompressionLevel(int compressionLevel)
Sets the compression level (0-9).
|
void |
setCompressionThreshold(int compressionThreshold)
Sets the minimum size of a request body must be in order to be compressed.
|
void |
setFallbackProtocol(String fallbackProtocol)
Sets the fallback protocol to use when negotiating via ALPN.
|
void |
setFileTypeHandlerConfiguration(NettyHttpServerConfiguration.FileTypeHandlerConfiguration fileTypeHandlerConfiguration)
Sets the file type handler configuration.
|
void |
setHttp2(NettyHttpServerConfiguration.Http2Settings http2)
Sets the Http2Settings.
|
void |
setInitialBufferSize(int initialBufferSize)
Sets the initial buffer size.
|
void |
setKeepAliveOnServerError(boolean keepAliveOnServerError)
Whether to send connection keep alive on internal server errors.
|
void |
setListeners(List<NettyHttpServerConfiguration.NettyListenerConfiguration> listeners)
Set the explicit netty listener configurations, or
null if they should be implicit. |
void |
setLogLevel(io.netty.handler.logging.LogLevel logLevel)
Sets the Netty log level.
|
void |
setMaxChunkSize(int maxChunkSize)
Sets the maximum size of any single request chunk.
|
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).
|
void |
setMaxHeaderSize(int maxHeaderSize)
Sets the maximum size of any one header.
|
void |
setMaxInitialLineLength(int maxInitialLineLength)
Sets the maximum initial line length for the HTTP request.
|
void |
setOptions(Map<io.netty.channel.ChannelOption,Object> options)
Sets the channel options.
|
void |
setParent(NettyHttpServerConfiguration.Parent parent)
Sets the parent event loop configuration.
|
void |
setPcapLoggingPathPattern(String pcapLoggingPathPattern)
The path pattern to use for logging incoming connections to pcap.
|
void |
setUseNativeTransport(boolean useNativeTransport)
Sets whether to use netty's native transport (epoll or kqueue) if available .
|
void |
setValidateHeaders(boolean validateHeaders)
Sets whether to validate incoming headers.
|
void |
setWorker(NettyHttpServerConfiguration.Worker worker)
Sets the worker event loop configuration.
|
getApplicationConfiguration, getClientAddressHeader, getContextPath, getCors, getDefaultCharset, getHost, getHostResolution, getHttpVersion, getIdleTimeout, getLocaleResolution, getMaxRequestSize, getMultipart, getPort, getReadIdleTimeout, getReadTimeout, getServerHeader, getThreadSelection, getWriteIdleTimeout, isDateHeader, isDualProtocol, isHttpToHttpsRedirect, isLogHandledExceptions, setClientAddressHeader, setContextPath, setCors, setDateHeader, setDefaultCharset, setDualProtocol, setHost, setHostResolution, setHttpToHttpsRedirect, setHttpVersion, setIdleTimeout, setLocaleResolution, setLogHandledExceptions, setMaxRequestSize, setMultipart, setPort, setReadIdleTimeout, setReadTimeout, setServerHeader, setThreadSelection, setWriteIdleTimeout
public static final boolean DEFAULT_USE_NATIVE_TRANSPORT
public static final int DEFAULT_MAXINITIALLINELENGTH
public static final int DEFAULT_MAXHEADERSIZE
public static final int DEFAULT_MAXCHUNKSIZE
public static final boolean DEFAULT_CHUNKSUPPORTED
public static final boolean DEFAULT_VALIDATEHEADERS
public static final int DEFAULT_INITIALBUFFERSIZE
public static final int DEFAULT_COMPRESSIONTHRESHOLD
public static final int DEFAULT_COMPRESSIONLEVEL
public static final boolean DEFAULT_KEEP_ALIVE_ON_SERVER_ERROR
public NettyHttpServerConfiguration()
public NettyHttpServerConfiguration(ApplicationConfiguration applicationConfiguration)
applicationConfiguration
- The application configuration@Inject public NettyHttpServerConfiguration(ApplicationConfiguration applicationConfiguration, List<ChannelPipelineListener> pipelineCustomizers)
applicationConfiguration
- The application configurationpipelineCustomizers
- A list of pipeline customizerspublic NettyHttpServerConfiguration.AccessLogger getAccessLogger()
public void setAccessLogger(NettyHttpServerConfiguration.AccessLogger accessLogger)
accessLogger
- The configuration .public NettyHttpServerConfiguration.Http2Settings getHttp2()
public void setHttp2(NettyHttpServerConfiguration.Http2Settings http2)
http2
- The Http2Settings.public List<ChannelPipelineListener> getPipelineCustomizers()
public String getFallbackProtocol()
ApplicationProtocolNames
public void setFallbackProtocol(String fallbackProtocol)
fallbackProtocol
- The fallback protocol to use when negotiating via ALPNApplicationProtocolNames
public Optional<io.netty.handler.logging.LogLevel> getLogLevel()
LogLevel
to enable.LogLevel
to enablepublic int getMaxInitialLineLength()
public int getMaxHeaderSize()
public int getMaxChunkSize()
public int getMaxH2cUpgradeRequestSize()
OPTIONS /
), or switch to normal
HTTP2.
Does not affect normal HTTP2 (TLS).
public boolean isChunkedSupported()
public boolean isUseNativeTransport()
public boolean isValidateHeaders()
public int getInitialBufferSize()
public int getCompressionThreshold()
public int getCompressionLevel()
public Map<io.netty.channel.ChannelOption,Object> getChildOptions()
ServerBootstrap.childOption(io.netty.channel.ChannelOption, Object)
public Map<io.netty.channel.ChannelOption,Object> getOptions()
ServerBootstrap.childOption(io.netty.channel.ChannelOption, Object)
public NettyHttpServerConfiguration.Worker getWorker()
EventLoopGroup
@NonNull public NettyHttpServerConfiguration.FileTypeHandlerConfiguration getFileTypeHandlerConfiguration()
@Inject public void setFileTypeHandlerConfiguration(@NonNull NettyHttpServerConfiguration.FileTypeHandlerConfiguration fileTypeHandlerConfiguration)
fileTypeHandlerConfiguration
- The file type handler configurationpublic NettyHttpServerConfiguration.Parent getParent()
EventLoopGroup
public boolean isKeepAliveOnServerError()
public void setChildOptions(Map<io.netty.channel.ChannelOption,Object> childOptions)
childOptions
- The optionspublic void setOptions(Map<io.netty.channel.ChannelOption,Object> options)
options
- The channel optionspublic void setWorker(NettyHttpServerConfiguration.Worker worker)
worker
- The worker configpublic void setParent(NettyHttpServerConfiguration.Parent parent)
parent
- The parent configpublic void setMaxInitialLineLength(@ReadableBytes int maxInitialLineLength)
maxInitialLineLength
- The max lengthpublic void setMaxHeaderSize(@ReadableBytes int maxHeaderSize)
maxHeaderSize
- The max header sizepublic void setMaxChunkSize(@ReadableBytes int maxChunkSize)
maxChunkSize
- The max chunk sizepublic void setMaxH2cUpgradeRequestSize(int maxH2cUpgradeRequestSize)
OPTIONS /
), or switch to normal
HTTP2.
Does not affect normal HTTP2 (TLS).
maxH2cUpgradeRequestSize
- The maximum content length of the request.public void setChunkedSupported(boolean chunkedSupported)
chunkedSupported
- True if it is supportedpublic void setUseNativeTransport(boolean useNativeTransport)
useNativeTransport
- True if netty's native transport should be use if available.public void setValidateHeaders(boolean validateHeaders)
validateHeaders
- True if headers should be validated.public void setInitialBufferSize(int initialBufferSize)
initialBufferSize
- The initial buffer sizepublic void setLogLevel(io.netty.handler.logging.LogLevel logLevel)
logLevel
- The log levelpublic void setCompressionThreshold(@ReadableBytes int compressionThreshold)
compressionThreshold
- The size request bodies must be in order to be a candidate for compression.public void setCompressionLevel(@ReadableBytes int compressionLevel)
compressionLevel
- The compression level.public void setKeepAliveOnServerError(boolean keepAliveOnServerError)
keepAliveOnServerError
- The keep alive on server error flag@Internal public String getPcapLoggingPathPattern()
null
if logging is disabled.@Internal public void setPcapLoggingPathPattern(String pcapLoggingPathPattern)
pcapLoggingPathPattern
- The path pattern, or null
to disable logging.public List<NettyHttpServerConfiguration.NettyListenerConfiguration> getListeners()
null
if they should be implicit.public void setListeners(List<NettyHttpServerConfiguration.NettyListenerConfiguration> listeners)
null
if they should be implicit.listeners
- The listeners