Class Flags
FlagsProvider.priority(). On each flag, if value is fail to validated. The next candidate will be
used.-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanReturns whether to allow double dots (..) in a request path query string.static booleanReturns whether to allow a semicolon (;) in a request path component on the server-side.static ExceptionVerbosityDeprecated.Returns the list of HTTP header names whose corresponding values will be cached, as specified inheaderValueCacheSpec().static Stringstatic longReturns the default client-side graceful connection shutdown timeout in milliseconds.static longReturns the default client-side idle timeout of a connection for keep-alive in milliseconds.static booleanReturns the default option that is preventing the server from staying in an idle state when an HTTP/2 PING frame is received.static longReturns the default client-side timeout of a socket connection attempt in milliseconds.static longReturns the default time in milliseconds to wait before closing an HTTP/1 connection when a server needs to close the connection.static intReturns the default maximum length of each chunk in an HTTP/1 request or response content.static intReturns the default maximum length of all HTTP/1 headers in a request or response.static intReturns the default maximum length of an HTTP/1 initial line.static intReturns the default value of theServerBuilder.http2InitialConnectionWindowSize(int)andClientFactoryBuilder.http2InitialConnectionWindowSize(int)option.static intReturns the default value of theServerBuilder.http2InitialStreamWindowSize(int)andClientFactoryBuilder.http2InitialStreamWindowSize(int)option.static intReturns the default value of theServerBuilder.http2MaxFrameSize(int)andClientFactoryBuilder.http2MaxFrameSize(int)option.static longReturns the default value of theServerBuilder.http2MaxHeaderListSize(long)andClientFactoryBuilder.http2MaxHeaderListSize(long)option.static longReturns the default value of theServerBuilder.http2MaxStreamsPerConnection(long)option.static longReturns the default client-side max age of a connection for keep-alive in milliseconds.static intReturns the default maximum client hello length that a server allows.static intReturns the client-side maximum allowed number of requests that can be sent through one connection.static longReturns the default server-side maximum length of a request.static longReturns the default client-side maximum length of a response.static longReturns the default server-side max age of a connection for keep-alive in milliseconds.static intReturns the server-side maximum allowed number of requests that can be served through one connection.static intReturns the default maximum number of total attempts.static MultipartRemovalStrategyReturns theMultipartRemovalStrategythat is used to determine how to remove the uploaded files frommultipart/form-data.static PathReturns thePaththat is used to store the files uploaded frommultipart/form-datarequests.static longReturns the default value for the PING interval.static booleanReturns the default value of theClientFactoryBuilder.preferHttp1(boolean)option.static longReturns the amount of time to wait by default before aborting anHttpRequestwhen its correspondingHttpResponseis complete.static longReturns the default server-side timeout of a request in milliseconds.static longReturns the default client-side timeout of a response in milliseconds.static longReturns the default server-side graceful connection shutdown drain duration in microseconds.static intReturns the default maximum number of RST frames that are allowed per window before the connection is closed.static longReturns the default server-side idle timeout of a connection for keep-alive in milliseconds.static booleanReturns the default option that is preventing the server from staying in an idle state when an HTTP/2 PING frame is received.static longDeprecated.UsedefaultUnloggedExceptionsReportIntervalMillis()instead.static longReturns the default interval in milliseconds between the reports on unlogged exceptions.static booleanReturns the default value of theClientFactoryBuilder.useHttp1Pipelining(boolean)option.static booleanReturns the default value of theClientFactoryBuilder.useHttp2Preface(boolean)option.static booleanReturns the default value of theClientFactoryBuilder.useHttp2WithoutAlpn(boolean)option.static longReturns the default client-side timeout of a socket write attempt in milliseconds.static DistributionStatisticConfigReturns the defaultDistributionStatisticConfigof theTimers andDistributionSummarys created by Armeria.static StringReturns the Caffeine specification string of the cache that stores the domain names and their resolved addresses.static booleanReturns whether information about the OpenSSL environment should be dumped when first starting the application, including supported ciphers.Returns the Caffeine specification string of the cache that stores the content of theHttpFiles read by aFileService.Returns the Caffeine specification string of the cache that stores the recent results for converting a raw HTTP ASCII header value into aString.static intReturns the default server-side maximum number of connections.static MeterRegistryReturns theMeterRegistrywhere armeria records metrics to by default.static intReturns the default number of blocking task executor threads.static intReturns the default number of common worker group threads.Returns the Caffeine specification string of the cache that stores the recent results for parsing a raw HTTP path into a decoded pair of path and query string.static Predicate<InetAddress> Returns thePredicatethat is used to choose the non-loopback IP v4 address inSystemInfo.defaultNonLoopbackIpV4Address().static booleanReturns whetherCompletableFutures returned by Armeria methods log a warning ifCompletableFuture.join()orCompletableFuture.get()are called from an event loop thread.static booleanReturns whether to log a warning if aServiceWithRoutesis added to aServerBuilderusing the methods that requires a path pattern, such asServerBuilder.service(String, HttpService).static Sampler<? super RequestContext> Returns theSamplerthat determines whether to trace the stack trace of request contexts leaks and how frequently to keeps stack trace.Returns theRequestContextStorageProviderthat provides theRequestContextStorage.Returns the Caffeine specification string of the cache that stores the recent request routing history for allServices.Returns the Caffeine specification string of the cache that stores the recent request routing history for all route decorators.static booleanReturns whether to allow the bad cipher suites listed in RFC7540 for TLS handshake.static TlsEngineTypeReturns theTlsEngineTypethat will be used for processing TLS connections.static Set<TransientServiceOption> static TransportTypeReturns theTransportTypethat will be used for socket I/O in Armeria.static booleanReturns whether default socket options defined by Armeria are enabled.static booleanuseEpoll()Deprecated.UsetransportType()and-Dcom.linecorp.armeria.transportType=epoll.static booleanEnablesDefaultAddressResolverGroupthat resolves domain name using JDK's built-in domain name lookup mechanism.static booleanReturns whether to order route decorators with legacy order that the first decorator is first applied to.static booleanDeprecated.UsetlsEngineType()and-Dcom.linecorp.armeria.tlsEngineType=openssl.static booleanEnables validation of HTTP headers for dangerous characters like newlines - such characters can be used for injecting arbitrary content into HTTP responses.Returns the specification of theSamplerthat determines whether to retain the stack trace of the exceptions that are thrown frequently by Armeria.static StringDeprecated.UseverboseExceptionSampler()and-Dcom.linecorp.armeria.verboseExceptions=<specification>.static booleanReturns whether the verbose response mode is enabled.static booleanReturns whether to log the socket exceptions which are mostly harmless.static booleanReturns whether to log a warning message when any Netty version issues are detected, such as version inconsistencies or missing version information in Netty JARs.
-
Method Details
-
verboseExceptionSampler
Returns the specification of theSamplerthat determines whether to retain the stack trace of the exceptions that are thrown frequently by Armeria. A sampled exception will have the stack trace while the others will have an empty stack trace to eliminate the cost of capturing the stack trace.The default value of this flag is "rate-limit=10", which retains the stack trace of the exceptions at the maximum rate of 10 exceptions/sec. Specify the
-Dcom.linecorp.armeria.verboseExceptions=<specification>JVM option to override the default. SeeSampler.of(String)for the specification string format. -
verboseExceptionSamplerSpec
Deprecated.UseverboseExceptionSampler()and-Dcom.linecorp.armeria.verboseExceptions=<specification>.Returns the specification string of theSamplerthat determines whether to retain the stack trace of the exceptions that are thrown frequently by Armeria.- See Also:
-
verboseSocketExceptions
public static boolean verboseSocketExceptions()Returns whether to log the socket exceptions which are mostly harmless. If enabled, the following exceptions will be logged:ClosedChannelExceptionClosedSessionExceptionIOException- 'Connection reset/closed/aborted by peer'- 'Broken pipe'
Http2Exception- 'Stream closed'SSLException- 'SSLEngine closed already'
It is recommended to keep this flag disabled, because it increases the amount of log messages for the errors you usually do not have control over, e.g. unexpected socket disconnection due to network or remote peer issues.
This flag is disabled by default. Specify the
-Dcom.linecorp.armeria.verboseSocketExceptions=trueJVM option to enable it.- See Also:
-
verboseResponses
public static boolean verboseResponses()Returns whether the verbose response mode is enabled. When enabled, the server responses will contain the exception type and its full stack trace, which may be useful for debugging while potentially insecure. When disabled, the server responses will not expose such server-side details to the client.This flag is disabled by default. Specify the
-Dcom.linecorp.armeria.verboseResponses=trueJVM option or useServerBuilder.verboseResponses(boolean)to enable it. -
requestContextStorageProvider
Returns theRequestContextStorageProviderthat provides theRequestContextStorage.By default, If no
RequestContextStorageProviderSPI provider implementation is provided, This flag returnsRequestContextStorageProviderthat providesRequestContextStorage.threadLocal(). Otherwise, the firstRequestContextStorageProviderSPI provider implementation will be selected.By specifying the
-Dcom.linecorp.armeria.requestContextStorageProvider=<FQCN>JVM option, you are able to select whichRequestContextStorageProviderSPI provider implementation to used. If none of them matches, the nextFlagsProvider.requestContextStorageProvider()will be selected. -
warnNettyVersions
public static boolean warnNettyVersions()Returns whether to log a warning message when any Netty version issues are detected, such as version inconsistencies or missing version information in Netty JARs.The default value of this flag is
true, which means a warning message will be logged if any Netty version issues are detected, which may lead to unexpected behavior. Specify the-Dcom.linecorp.armeria.warnNettyVersions=falseto disable this flag. -
useEpoll
Deprecated.UsetransportType()and-Dcom.linecorp.armeria.transportType=epoll.Returns whether the JNI-based/dev/epollsocket I/O is enabled. When enabled on Linux, Armeria uses/dev/epolldirectly for socket I/O. When disabled,java.niosocket API is used instead.This flag is enabled by default for supported platforms. Specify the
-Dcom.linecorp.armeria.useEpoll=falseJVM option to disable it. -
transportType
Returns theTransportTypethat will be used for socket I/O in Armeria.The default value of this flag is
"epoll"in Linux and"nio"for other operations systems. Specify the-Dcom.linecorp.armeria.transportType=<nio|epoll|io_uring>JVM option to override the default. -
useOpenSsl
Deprecated.UsetlsEngineType()and-Dcom.linecorp.armeria.tlsEngineType=openssl.Returns whether the JNI-based TLS support with OpenSSL is enabled. When enabled, Armeria uses OpenSSL for processing TLS connections. When disabled, the current JVM's defaultSSLEngineis used instead.This flag is enabled by default for supported platforms. Specify the
-Dcom.linecorp.armeria.useOpenSsl=falseJVM option to disable it. -
tlsEngineType
Returns theTlsEngineTypethat will be used for processing TLS connections.The default value of this flag is
TlsEngineType.OPENSSL. Specify the-Dcom.linecorp.armeria.tlsEngineType=<jdk|openssl>JVM option to override the default value. -
dumpOpenSslInfo
public static boolean dumpOpenSslInfo()Returns whether information about the OpenSSL environment should be dumped when first starting the application, including supported ciphers.This flag is disabled by default. Specify the
-Dcom.linecorp.armeria.dumpOpenSslInfo=trueJVM option to enable it.If
tlsEngineType()does not returnTlsEngineType.OPENSSL, this also returnsfalseno matter what the specified JVM option is. -
maxNumConnections
public static int maxNumConnections()Returns the default server-side maximum number of connections. Note that this flag has no effect if a user specified the value explicitly viaServerBuilder.maxNumConnections(int).The default value of this flag is 2147483647. Specify the
-Dcom.linecorp.armeria.maxNumConnections=<integer>JVM option to override the default value. -
numCommonWorkers
public static int numCommonWorkers()Returns the default number of common worker group threads. Note that this flag has no effect if a user specified the worker group explicitly viaServerBuilder.workerGroup(EventLoopGroup, boolean)orClientFactoryBuilder.workerGroup(EventLoopGroup, boolean).The default value of this flag is
2 * <numCpuCores>forTransportType.NIO,TransportType.EPOLLandTransportType.KQUEUEand<numCpuCores>forTransportType.IO_URING. Specify the-Dcom.linecorp.armeria.numCommonWorkers=<integer>JVM option to override the default value. -
numCommonBlockingTaskThreads
public static int numCommonBlockingTaskThreads()Returns the default number of blocking task executor threads. Note that this flag has no effect if a user specified the blocking task executor explicitly viaServerBuilder.blockingTaskExecutor(ScheduledExecutorService, boolean).The default value of this flag is 200. Specify the
-Dcom.linecorp.armeria.numCommonBlockingTaskThreads=<integer>JVM option to override the default value. -
defaultMaxRequestLength
public static long defaultMaxRequestLength()Returns the default server-side maximum length of a request. Note that this flag has no effect if a user specified the value explicitly viaServerBuilder.maxRequestLength(long).The default value of this flag is 10485760L. Specify the
-Dcom.linecorp.armeria.defaultMaxRequestLength=<long>to override the default value.0disables the length limit. -
defaultMaxResponseLength
public static long defaultMaxResponseLength()Returns the default client-side maximum length of a response. Note that this flag has no effect if a user specified the value explicitly viaClientBuilder.maxResponseLength(long).The default value of this flag is 10485760L. Specify the
-Dcom.linecorp.armeria.defaultMaxResponseLength=<long>to override the default value.0disables the length limit. -
defaultRequestTimeoutMillis
public static long defaultRequestTimeoutMillis()Returns the default server-side timeout of a request in milliseconds. Note that this flag has no effect if a user specified the value explicitly viaServerBuilder.requestTimeout(Duration).The default value of this flag is 10000L. Specify the
-Dcom.linecorp.armeria.defaultRequestTimeoutMillis=<long>to override the default value.0disables the timeout. -
defaultResponseTimeoutMillis
public static long defaultResponseTimeoutMillis()Returns the default client-side timeout of a response in milliseconds. Note that this flag has no effect if a user specified the value explicitly viaClientBuilder.responseTimeout(Duration).The default value of this flag is 15000L. Specify the
-Dcom.linecorp.armeria.defaultResponseTimeoutMillis=<long>to override the default value.0disables the timeout. -
defaultConnectTimeoutMillis
public static long defaultConnectTimeoutMillis()Returns the default client-side timeout of a socket connection attempt in milliseconds. Note that this flag has no effect if a user specified the value explicitly viaClientFactoryBuilder.channelOption(ChannelOption, Object).The default value of this flag is 3200L. Specify the
-Dcom.linecorp.armeria.defaultConnectTimeoutMillis=<integer>JVM option to override the default value. -
defaultWriteTimeoutMillis
public static long defaultWriteTimeoutMillis()Returns the default client-side timeout of a socket write attempt in milliseconds. Note that this flag has no effect if a user specified the value explicitly viaClientBuilder.writeTimeout(Duration).The default value of this flag is 1000L. Specify the
-Dcom.linecorp.armeria.defaultWriteTimeoutMillis=<integer>JVM option to override the default value.0disables the timeout. -
defaultServerIdleTimeoutMillis
public static long defaultServerIdleTimeoutMillis()Returns the default server-side idle timeout of a connection for keep-alive in milliseconds. Note that this flag has no effect if a user specified the value explicitly viaServerBuilder.idleTimeout(Duration).The default value of this flag is 15000L. Specify the
-Dcom.linecorp.armeria.defaultServerIdleTimeoutMillis=<integer>JVM option to override the default value. -
defaultServerKeepAliveOnPing
public static boolean defaultServerKeepAliveOnPing()Returns the default option that is preventing the server from staying in an idle state when an HTTP/2 PING frame is received.The default value of this flag is false. Specify the
-Dcom.linecorp.armeria.defaultServerKeepAliveOnPing=<boolean>JVM option to override the default value. -
defaultClientIdleTimeoutMillis
public static long defaultClientIdleTimeoutMillis()Returns the default client-side idle timeout of a connection for keep-alive in milliseconds. Note that this flag has no effect if a user specified the value explicitly viaClientFactoryBuilder.idleTimeout(Duration).This default value of this flag is 10000L. Specify the
-Dcom.linecorp.armeria.defaultClientIdleTimeoutMillis=<integer>JVM option to override the default value. -
defaultClientKeepAliveOnPing
public static boolean defaultClientKeepAliveOnPing()Returns the default option that is preventing the server from staying in an idle state when an HTTP/2 PING frame is received.The default value of this flag is false. Specify the
-Dcom.linecorp.armeria.defaultClientKeepAliveOnPing=<boolean>JVM option to override the default value. -
defaultHttp1MaxInitialLineLength
public static int defaultHttp1MaxInitialLineLength()Returns the default maximum length of an HTTP/1 initial line. Note that this flag has no effect if a user specified the value explicitly viaServerBuilder.http1MaxInitialLineLength(int)orClientFactoryBuilder.http1MaxInitialLineLength(int).This default value of this flag is 4096. Specify the
-Dcom.linecorp.armeria.defaultHttp1MaxInitialLineLength=<integer>JVM option to override the default value. -
defaultHttp1MaxHeaderSize
public static int defaultHttp1MaxHeaderSize()Returns the default maximum length of all HTTP/1 headers in a request or response. Note that this flag has no effect if a user specified the value explicitly viaServerBuilder.http1MaxHeaderSize(int)orClientFactoryBuilder.http1MaxHeaderSize(int).This default value of this flag is 8192. Specify the
-Dcom.linecorp.armeria.defaultHttp1MaxHeaderSize=<integer>JVM option to override the default value. -
defaultHttp1MaxChunkSize
public static int defaultHttp1MaxChunkSize()Returns the default maximum length of each chunk in an HTTP/1 request or response content. The content or a chunk longer than this value will be split into smaller chunks so that their lengths never exceed it. Note that this flag has no effect if a user specified the value explicitly viaServerBuilder.http1MaxChunkSize(int)orClientFactoryBuilder.http1MaxChunkSize(int).The default value of this flag is 8192. Specify the
-Dcom.linecorp.armeria.defaultHttp1MaxChunkSize=<integer>JVM option to override the default value. -
defaultUseHttp2Preface
public static boolean defaultUseHttp2Preface()Returns the default value of theClientFactoryBuilder.useHttp2Preface(boolean)option. If enabled, the HTTP/2 connection preface is sent immediately for a cleartext HTTP/2 connection, reducing an extra round trip incurred by theOPTIONS * HTTP/1.1upgrade request. If disabled, theOPTIONS * HTTP/1.1request with"Upgrade: h2c"header is sent for a cleartext HTTP/2 connection. Consider disabling this flag if your HTTP servers have issues handling or rejecting the HTTP/2 connection preface without a upgrade request.Note that this option is only effective when the
SessionProtocolof theEndpointisSessionProtocol.HTTP. This option does not affect ciphertext HTTP/2 connections, which use ALPN for protocol negotiation, orSessionProtocol.H2C, which will always use HTTP/2 connection preface. This option is ignored if a user specified the value explicitly viaClientFactoryBuilder.useHttp2Preface(boolean).This flag is enabled by default. Specify the
-Dcom.linecorp.armeria.defaultUseHttp2Preface=falseJVM option to disable it. -
defaultPreferHttp1
Returns the default value of theClientFactoryBuilder.preferHttp1(boolean)option. If enabled, the client will not attempt to upgrade to HTTP/2 forSessionProtocol.HTTPandSessionProtocol.HTTPS. However, the client will use HTTP/2 ifSessionProtocol.H2orSessionProtocol.H2Cis used.Note that this option has no effect if a user specified the value explicitly via
ClientFactoryBuilder.preferHttp1(boolean).This flag is disabled by default. Specify the
-Dcom.linecorp.armeria.defaultPreferHttp1=trueJVM option to enable it. -
defaultUseHttp2WithoutAlpn
Returns the default value of theClientFactoryBuilder.useHttp2WithoutAlpn(boolean)option. If enabled, even when ALPN negotiation fails client will try to attempt upgrade to HTTP/2 when needed. This will be either HTTP/2 connection preface or HTTP/1-to-2 upgrade request, depending onClientFactoryBuilder.useHttp2Preface(boolean)setting. If disabled, when ALPN negotiation fails client will also fail in case HTTP/2 was required.ClientFactoryBuilder.useHttp2WithoutAlpn(boolean).This flag is disabled by default. Specify the
-Dcom.linecorp.armeria.defaultUseHttp2WithoutAlpn=trueJVM option to enable it. -
defaultUseHttp1Pipelining
public static boolean defaultUseHttp1Pipelining()Returns the default value of theClientFactoryBuilder.useHttp1Pipelining(boolean)option. Note that this flag has no effect if a user specified the value explicitly viaClientFactoryBuilder.useHttp1Pipelining(boolean).This flag is disabled by default. Specify the
-Dcom.linecorp.armeria.defaultUseHttp1Pipelining=trueJVM option to enable it. -
defaultPingIntervalMillis
public static long defaultPingIntervalMillis()Returns the default value for the PING interval. A PING frame is sent for HTTP/2 server and client or an OPTIONS request with an asterisk ("*") is sent for HTTP/1 client.Note that this flag is only in effect when
defaultServerIdleTimeoutMillis()for server anddefaultClientIdleTimeoutMillis()for client are greater than the value of this flag.The default value of this flag is 0L milliseconds. Specify the
-Dcom.linecorp.armeria.defaultPingIntervalMillis=<integer>JVM option to override the default value. If the specified value was smaller than 10 seconds, bumps PING interval to 10 seconds. -
defaultMaxServerNumRequestsPerConnection
public static int defaultMaxServerNumRequestsPerConnection()Returns the server-side maximum allowed number of requests that can be served through one connection.Note that this flag has no effect if a user specified the value explicitly via
ServerBuilder.maxNumRequestsPerConnection(int).The default value of this flag is 0. Specify the
-Dcom.linecorp.armeria.defaultMaxServerNumRequestsPerConnection=<integer>JVM option to override the default value.0disables the limit. -
defaultMaxClientNumRequestsPerConnection
public static int defaultMaxClientNumRequestsPerConnection()Returns the client-side maximum allowed number of requests that can be sent through one connection.Note that this flag has no effect if a user specified the value explicitly via
ClientFactoryBuilder.maxNumRequestsPerConnection(int).The default value of this flag is 0. Specify the
-Dcom.linecorp.armeria.defaultMaxClientNumRequestsPerConnection=<integer>JVM option to override the default value.0disables the limit. -
defaultMaxServerConnectionAgeMillis
public static long defaultMaxServerConnectionAgeMillis()Returns the default server-side max age of a connection for keep-alive in milliseconds. If the value of this flag is greater than0, a connection is disconnected after the specified amount of the time since the connection was established.The default value of this flag is 0L. Specify the
-Dcom.linecorp.armeria.defaultMaxServerConnectionAgeMillis=<integer>JVM option to override the default value. If the specified value was smaller than 1 second, bumps the max connection age to 1 second.- See Also:
-
defaultMaxClientConnectionAgeMillis
public static long defaultMaxClientConnectionAgeMillis()Returns the default client-side max age of a connection for keep-alive in milliseconds. If the value of this flag is greater than0, a connection is disconnected after the specified amount of the time since the connection was established.The default value of this flag is 0L. Specify the
-Dcom.linecorp.armeria.defaultMaxClientConnectionAgeMillis=<integer>JVM option to override the default value. If the specified value was smaller than 1 second, bumps the max connection age to 1 second.- See Also:
-
defaultServerConnectionDrainDurationMicros
public static long defaultServerConnectionDrainDurationMicros()Returns the default server-side graceful connection shutdown drain duration in microseconds. If the value of this flag is greater than0, a connection shutdown will have a drain period when client will be notified about the shutdown, but in flight requests will still be accepted.The default value of this flag is 1000000L. Specify the
-Dcom.linecorp.armeria.defaultServerConnectionDrainDurationMicros=<long>JVM option to override the default value.At the beginning of the drain period server signals the clients that the connection shutdown is imminent but still accepts in flight requests. After the drain period end server stops accepting new requests.
Note that HTTP/1 doesn't support draining as described here, so for HTTP/1 drain period microseconds is always
0, which means the connection will be closed immediately as soon as the current in-progress request is handled.- See Also:
-
defaultClientHttp2GracefulShutdownTimeoutMillis
public static long defaultClientHttp2GracefulShutdownTimeoutMillis()Returns the default client-side graceful connection shutdown timeout in milliseconds.0disables the timeout and closes the connection immediately after sending a GOAWAY frame.The default value of this flag is 1000L. Specify the
-Dcom.linecorp.armeria.defaultClientHttp2GracefulShutdownTimeoutMillis=<long>JVM option to override the default value. After the drain period end client will close all the connections.- See Also:
-
defaultHttp2InitialConnectionWindowSize
public static int defaultHttp2InitialConnectionWindowSize()Returns the default value of theServerBuilder.http2InitialConnectionWindowSize(int)andClientFactoryBuilder.http2InitialConnectionWindowSize(int)option. Note that this flag has no effect if a user specified the value explicitly viaServerBuilder.http2InitialConnectionWindowSize(int)orClientFactoryBuilder.http2InitialConnectionWindowSize(int).The default value of this flag is 1048576. Specify the
-Dcom.linecorp.armeria.defaultHttp2InitialConnectionWindowSize=<integer>JVM option to override the default value. -
defaultHttp2InitialStreamWindowSize
public static int defaultHttp2InitialStreamWindowSize()Returns the default value of theServerBuilder.http2InitialStreamWindowSize(int)andClientFactoryBuilder.http2InitialStreamWindowSize(int)option. Note that this flag has no effect if a user specified the value explicitly viaServerBuilder.http2InitialStreamWindowSize(int)orClientFactoryBuilder.http2InitialStreamWindowSize(int).The default value of this flag is 1048576. Specify the
-Dcom.linecorp.armeria.defaultHttp2InitialStreamWindowSize=<integer>JVM option to override the default value. -
defaultHttp2MaxFrameSize
public static int defaultHttp2MaxFrameSize()Returns the default value of theServerBuilder.http2MaxFrameSize(int)andClientFactoryBuilder.http2MaxFrameSize(int)option. Note that this flag has no effect if a user specified the value explicitly viaServerBuilder.http2MaxFrameSize(int)orClientFactoryBuilder.http2MaxFrameSize(int).The default value of this flag is 16384. Specify the
-Dcom.linecorp.armeria.defaultHttp2MaxFrameSize=<integer>JVM option to override the default value. -
defaultHttp2MaxStreamsPerConnection
public static long defaultHttp2MaxStreamsPerConnection()Returns the default value of theServerBuilder.http2MaxStreamsPerConnection(long)option. Note that this flag has no effect if a user specified the value explicitly viaServerBuilder.http2MaxStreamsPerConnection(long).The default value of this flag is 2147483647L. Specify the
-Dcom.linecorp.armeria.defaultHttp2MaxStreamsPerConnection=<integer>JVM option to override the default value. -
defaultHttp2MaxHeaderListSize
public static long defaultHttp2MaxHeaderListSize()Returns the default value of theServerBuilder.http2MaxHeaderListSize(long)andClientFactoryBuilder.http2MaxHeaderListSize(long)option. Note that this flag has no effect if a user specified the value explicitly viaServerBuilder.http2MaxHeaderListSize(long)orClientFactoryBuilder.http2MaxHeaderListSize(long).The default value of this flag is 8192L. Specify the
-Dcom.linecorp.armeria.defaultHttp2MaxHeaderListSize=<integer>JVM option to override the default value. -
defaultServerHttp2MaxResetFramesPerMinute
Returns the default maximum number of RST frames that are allowed per window before the connection is closed. This allows to protect against the remote peer flooding us with such frames and using up a lot of CPU. Note that this flag has no effect if a user specified the value explicitly viaServerBuilder.http2MaxResetFramesPerWindow(int, int).The default value of this flag is 400. Specify the
-Dcom.linecorp.armeria.defaultServerHttp2MaxResetFramesPerMinute=<integer>JVM option to override the default value.0means no protection should be applied. -
defaultBackoffSpec
Returns the Backoff specification string of the defaultBackoffreturned byBackoff.ofDefault(). Note that this flag has no effect if a user specified theBackoffexplicitly.The default value of this flag is "exponential=200:10000,jitter=0.2". Specify the
-Dcom.linecorp.armeria.defaultBackoffSpec=<spec>JVM option to override the default value. -
defaultMaxTotalAttempts
public static int defaultMaxTotalAttempts()Returns the default maximum number of total attempts. Note that this flag has no effect if a user specified the value explicitly when creating aRetryingClientor aRetryingRpcClient.The default value of this flag is 10. Specify the
-Dcom.linecorp.armeria.defaultMaxTotalAttempts=<integer>JVM option to override the default value. -
defaultRequestAutoAbortDelayMillis
Returns the amount of time to wait by default before aborting anHttpRequestwhen its correspondingHttpResponseis complete. Note that this flag has no effect if a user specified the value explicitly viaServerBuilder.requestAutoAbortDelayMillis(long)(long)} orClientBuilder.requestAutoAbortDelayMillis(long).The default value of this flag is 0L. Specify the
-Dcom.linecorp.armeria.defaultRequestAutoAbortDelayMillis=<long>JVM option to override the default value. -
routeCacheSpec
Returns the Caffeine specification string of the cache that stores the recent request routing history for allServices.The default value of this flag is "maximumSize=4096". Specify the
-Dcom.linecorp.armeria.routeCache=<spec>JVM option to override the default value. For example,-Dcom.linecorp.armeria.routeCache=maximumSize=4096,expireAfterAccess=600s. Also, specify-Dcom.linecorp.armeria.routeCache=offJVM option to disable it. -
routeDecoratorCacheSpec
Returns the Caffeine specification string of the cache that stores the recent request routing history for all route decorators.The default value of this flag is "maximumSize=4096". Specify the
-Dcom.linecorp.armeria.routeDecoratorCache=<spec>JVM option to override the default value. For example,-Dcom.linecorp.armeria.routeDecoratorCache=maximumSize=4096,expireAfterAccess=600s. Also, specify-Dcom.linecorp.armeria.routeDecoratorCache=offJVM option to disable it. -
parsedPathCacheSpec
Returns the Caffeine specification string of the cache that stores the recent results for parsing a raw HTTP path into a decoded pair of path and query string.The default value of this flag is "maximumSize=4096". Specify the
-Dcom.linecorp.armeria.parsedPathCache=<spec>JVM option to override the default value. For example,-Dcom.linecorp.armeria.parsedPathCache=maximumSize=4096,expireAfterAccess=600s. Also, specify-Dcom.linecorp.armeria.parsedPathCache=offJVM option to disable it. -
headerValueCacheSpec
Returns the Caffeine specification string of the cache that stores the recent results for converting a raw HTTP ASCII header value into aString. Only the header values whose corresponding header name is listed incachedHeaders()will be cached.The default value of this flag is "maximumSize=4096". Specify the
-Dcom.linecorp.armeria.headerValueCache=<spec>JVM option to override the default value. For example,-Dcom.linecorp.armeria.headerValueCache=maximumSize=4096,expireAfterAccess=600s. Also, specify-Dcom.linecorp.armeria.headerValueCache=offJVM option to disable it. -
cachedHeaders
Returns the list of HTTP header names whose corresponding values will be cached, as specified inheaderValueCacheSpec(). Only the header value whose corresponding header name is listed in this flag will be cached. It is not recommended to specify a header with high cardinality, which will defeat the purpose of caching.The default value of this flag is ":authority,:scheme,:method,accept-encoding,content-type". Specify the
-Dcom.linecorp.armeria.cachedHeaders=<comma separated list>JVM option to override the default. -
fileServiceCacheSpec
Returns the Caffeine specification string of the cache that stores the content of theHttpFiles read by aFileService. This value is used as the default ofFileServiceBuilder.entryCacheSpec(String).The default value of this flag is "maximumSize=1024". Specify the
-Dcom.linecorp.armeria.fileServiceCache=<spec>JVM option to override the default value. For example,-Dcom.linecorp.armeria.fileServiceCache=maximumSize=1024,expireAfterAccess=600s. Also, specify-Dcom.linecorp.armeria.fileServiceCache=offJVM option to disable it. -
dnsCacheSpec
Returns the Caffeine specification string of the cache that stores the domain names and their resolved addresses. This value is used as the default ofAbstractDnsResolverBuilder.cacheSpec(String).The default value of this flag is "maximumSize=4096". Specify the
-Dcom.linecorp.armeria.dnsCacheSpec=<spec>JVM option to override the default value. For example,-Dcom.linecorp.armeria.dnsCacheSpec=maximumSize=1024,expireAfterAccess=600s.This cache cannot be disabled with
"off"unlike other cache specification flags. -
annotatedServiceExceptionVerbosity
Deprecated.UseLoggingServiceor log exceptions usingServerBuilder.errorHandler(ServerErrorHandler).Returns the verbosity of exceptions logged by annotated HTTP services. The value of this property is one of the following:ExceptionVerbosity.ALL- logging all exceptions raised from annotated HTTP servicesExceptionVerbosity.UNHANDLED- logging exceptions which are not handled byExceptionHandlers provided by a user and are not well-known exceptionsExceptionVerbosity.NONE- no logging exceptions
WARNlevel.The default value of this flag is "unhandled". Specify the
-Dcom.linecorp.armeria.annotatedServiceExceptionVerbosity=<all|unhandled|none>JVM option to override the default value.- See Also:
-
preferredIpV4Addresses
Returns thePredicatethat is used to choose the non-loopback IP v4 address inSystemInfo.defaultNonLoopbackIpV4Address().This flag by default returns a
Predicatethat always returnstrue, which means all valid IPv4 addresses are preferred. Specify the-Dcom.linecorp.armeria.preferredIpV4Addresses=<csv>JVM option to override the default value. Thecsvshould be Classless Inter-domain Routing(CIDR)s or exact IP addresses separated by commas. For example,-Dcom.linecorp.armeria.preferredIpV4Addresses=211.111.111.111,10.0.0.0/8,192.168.1.0/24. -
useJdkDnsResolver
public static boolean useJdkDnsResolver()EnablesDefaultAddressResolverGroupthat resolves domain name using JDK's built-in domain name lookup mechanism. Note that JDK's built-in resolver performs a blocking name lookup from the caller thread, and thus this flag should be enabled only when the default asynchronous resolver does not work as expected, for example by always throwing aDnsNameResolverTimeoutException.This flag is disabled by default. Specify the
-Dcom.linecorp.armeria.useJdkDnsResolver=trueJVM option to enable it. -
reportBlockedEventLoop
public static boolean reportBlockedEventLoop()Returns whetherCompletableFutures returned by Armeria methods log a warning ifCompletableFuture.join()orCompletableFuture.get()are called from an event loop thread. Blocking an event loop thread in this manner reduces performance significantly, possibly causing deadlocks, so it should be avoided at all costs (e.g. usingthenApply()type methods to execute asynchronously or running the logic usingServiceRequestContext.blockingTaskExecutor().This flag is enabled by default. Specify the
-Dcom.linecorp.armeria.reportBlockedEventLoop=falseJVM option to disable it. -
reportMaskedRoutes
public static boolean reportMaskedRoutes()Returns whether to log a warning if aServiceWithRoutesis added to aServerBuilderusing the methods that requires a path pattern, such asServerBuilder.service(String, HttpService). For example, the following code will mask the returned route ("/foo") in favor of the specified route ("/bar"):> HttpServiceWithRoutes serviceWithRoutes = new HttpServiceWithRoutes() { > @Override > public HttpResponse serve(ServiceRequestContext ctx, HttpRequest req) { ... } > > @Override > public Set<Route> routes() { > return Set.of(Route.builder().path("/foo").build()); > } > }; > > Server.builder() > .service("/bar", serviceWithRoutes) > .build(); -
validateHeaders
public static boolean validateHeaders()Enables validation of HTTP headers for dangerous characters like newlines - such characters can be used for injecting arbitrary content into HTTP responses.DISCLAIMER: Do not disable this unless you know what you are doing. It is recommended to keep this validation enabled to ensure the sanity of responses. However, you may wish to disable the validation to improve performance when you are sure responses are always safe, for example when only HTTP/2 is used, or when you populate headers with known values, and have no chance of using untrusted ones.
See CWE-113 for more details on the security implications of this flag.
This flag is enabled by default. Specify the
-Dcom.linecorp.armeria.validateHeaders=falseJVM option to disable it. -
tlsAllowUnsafeCiphers
public static boolean tlsAllowUnsafeCiphers()Returns whether to allow the bad cipher suites listed in RFC7540 for TLS handshake. Note that this flag has no effect if a user specified the value explicitly viaClientFactoryBuilder.tlsAllowUnsafeCiphers(boolean).This flag is disabled by default. Specify the
-Dcom.linecorp.armeria.tlsAllowUnsafeCiphers=trueJVM option to enable it. -
defaultMaxClientHelloLength
public static int defaultMaxClientHelloLength()Returns the default maximum client hello length that a server allows. The length shouldn't exceed 16MiB as described in Handshake Protocol.The default value of this flag is 16384. Specify the
-Dcom.linecorp.armeria.defaultMaxClientHelloLength=<integer>JVM option to override the default value. -
transientServiceOptions
Returns theSetofTransientServiceOptions that are enabled for aTransientService.The default value of this flag is an empty string, which means all
TransientServiceOptions are disabled. Specify the-Dcom.linecorp.armeria.transientServiceOptions=<csv>JVM option to override the default value. For example,-Dcom.linecorp.armeria.transientServiceOptions=WITH_METRIC_COLLECTION,WITH_ACCESS_LOGGING. -
useDefaultSocketOptions
public static boolean useDefaultSocketOptions()Returns whether default socket options defined by Armeria are enabled. If enabled, the following socket options are set automatically when/dev/epollorio_uringis in use:- TCP_USER_TIMEOUT
- TCP_KEEPIDLE
- TCP_KEEPINTVL
This flag is enabled by default. Specify the
-Dcom.linecorp.armeria.useDefaultSocketOptions=falseJVM option to disable it. -
useLegacyRouteDecoratorOrdering
public static boolean useLegacyRouteDecoratorOrdering()Returns whether to order route decorators with legacy order that the first decorator is first applied to. For example, if a service and decorators are defined like the followings:
A request will go through the below decorators' order to reach theServer server = Server.builder() .service("/users", userService) .decoratorUnder("/", loggingDecorator) .decoratorUnder("/", authDecorator) .decoratorUnder("/", traceDecorator) .build();userService.request -> loggingDecorator -> authDecorator -> traceDecorator -> userService -
defaultMultipartUploadsLocation
Returns thePaththat is used to store the files uploaded frommultipart/form-datarequests. -
defaultMultipartRemovalStrategy
Returns theMultipartRemovalStrategythat is used to determine how to remove the uploaded files frommultipart/form-data. -
allowDoubleDotsInQueryString
public static boolean allowDoubleDotsInQueryString()Returns whether to allow double dots (..) in a request path query string.Note that double dots in a query string can lead to a vulnerability if a query param value contains an improper path such as
/download?path=../../secrets.txt. Therefore, extra caution should be taken when enabling this option, and you may need additional validations at the application level.This flag is disabled by default. Specify the
-Dcom.linecorp.armeria.allowDoubleDotsInQueryString=trueJVM option to enable it. -
allowSemicolonInPathComponent
public static boolean allowSemicolonInPathComponent()Returns whether to allow a semicolon (;) in a request path component on the server-side. If disabled, the substring from the semicolon to before the next slash, commonly referred to as matrix variables, is removed. For example,/foo;a=b/barwill be converted to/foo/bar. Also, an exception is raised if a semicolon is used for binding a service. For example, the following code raises an exception:
Note that this flag has no effect on the client-side.Server server = Server.builder() .service("/foo;bar", ...) .build();This flag is disabled by default. Specify the
-Dcom.linecorp.armeria.allowSemicolonInPathComponent=trueJVM option to enable it. -
requestContextLeakDetectionSampler
Returns theSamplerthat determines whether to trace the stack trace of request contexts leaks and how frequently to keeps stack trace. A sampled exception will have the stack trace while the others will have an empty stack trace to eliminate the cost of capturing the stack trace.The default value of this flag is
Sampler.never(). Specify the-Dcom.linecorp.armeria.requestContextLeakDetectionSampler=<specification>JVM option to override the default. This feature is disabled ifSampler.never()is specified. SeeSampler.of(String)for the specification string format. -
meterRegistry
Returns theMeterRegistrywhere armeria records metrics to by default.The default value of this flag is
Metrics.globalRegistry. -
defaultUnhandledExceptionsReportIntervalMillis
Deprecated.UsedefaultUnloggedExceptionsReportIntervalMillis()instead.Returns the default interval in milliseconds between the reports on unlogged exceptions.The default value of this flag is 10000L. Specify the
-Dcom.linecorp.armeria.defaultUnhandledExceptionsReportIntervalMillis=<long>JVM option to override the default value. -
defaultUnloggedExceptionsReportIntervalMillis
Returns the default interval in milliseconds between the reports on unlogged exceptions.The default value of this flag is 10000L. Specify the
-Dcom.linecorp.armeria.defaultUnloggedExceptionsReportIntervalMillis=<long>JVM option to override the default value. -
distributionStatisticConfig
Returns the defaultDistributionStatisticConfigof theTimers andDistributionSummarys created by Armeria.The default value of this flag is as follows:
DistributionStatisticConfig.builder() .percentilesHistogram(false) .serviceLevelObjectives() .percentiles( 0, 0.5, 0.75, 0.9, 0.95, 0.98, 0.99, 0.999, 1.0) .percentilePrecision(2) .minimumExpectedValue(1.0) .maximumExpectedValue(Double.MAX_VALUE) .expiry(Duration.ofMinutes(3)) .bufferLength(3) .build(); -
defaultHttp1ConnectionCloseDelayMillis
Returns the default time in milliseconds to wait before closing an HTTP/1 connection when a server needs to close the connection. This allows to avoid a server socket from remaining in the TIME_WAIT state instead of CLOSED when a connection is closed.The default value of this flag is 3000L. Specify the
-Dcom.linecorp.armeria.defaultHttp1ConnectionCloseDelayMillis=<long>JVM option to override the default value.0closes the connection immediately.
-
LoggingServiceor log exceptions usingServerBuilder.errorHandler(ServerErrorHandler).