Interface FlagsProvider

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@UnstableApi @FunctionalInterface public interface FlagsProvider
A Java SPI (Service Provider Interface) for the Flags values. Returning null to indicates that this FlagsProvider doesn't provide the flag.

Two FlagsProviders are provided by default.

  • The system property FlagsProvider which provides value from JVM option
  • The default FlagsProvider which provides the default values when flag isn't provides or fail
  • Method Details

    • priority

      int priority()
      Returns the priority of the FlagsProvider to determine which implementation to use first. The FlagsProvider with the highest priority would be used at first. The value could be specified between -2147483648 and 2147483647.
    • name

      default String name()
      Returns the name of the FlagsProvider to use for logging.
    • verboseExceptionSampler

      @Nullable default @Nullable Sampler<Class<? extends Throwable>> verboseExceptionSampler()
      Returns the specification of the Sampler that 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. See Sampler.of(String) for the specification string format.

    • verboseSocketExceptions

      @Nullable default @Nullable Boolean verboseSocketExceptions()
      Returns whether to log the socket exceptions which are mostly harmless. If enabled, the following exceptions will be logged:

      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=true JVM option to enable it.

      See Also:
    • verboseResponses

      @Nullable default @Nullable 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=true JVM option or use ServerBuilder.verboseResponses(boolean) to enable it.

    • requestContextStorageProvider

      @Nullable default @Nullable RequestContextStorageProvider requestContextStorageProvider()
      Returns the RequestContextStorageProvider that provides the RequestContextStorage.

      By default, If no RequestContextStorageProvider SPI provider implementation is provided, This flag returns RequestContextStorageProvider that provides RequestContextStorage.threadLocal(). Otherwise, the first RequestContextStorageProvider SPI provider implementation will be selected.

      By specifying the -Dcom.linecorp.armeria.requestContextStorageProvider=<FQCN> JVM option, you are able to select which RequestContextStorageProvider SPI provider implementation to used. If none of them matches, the next requestContextStorageProvider() will be selected.

    • warnNettyVersions

      @Nullable default @Nullable 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=false to disable this flag.

    • transportType

      @Nullable default @Nullable TransportType transportType()
      Returns the TransportType that 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

      @Nullable default @Nullable Boolean useOpenSsl()
      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 default SSLEngine is used instead.

      This flag is enabled by default for supported platforms. Specify the -Dcom.linecorp.armeria.useOpenSsl=false JVM option to disable it.

    • dumpOpenSslInfo

      @Nullable default @Nullable 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=true JVM option to enable it.

      If useOpenSsl() returns false, this also returns false no matter you specified the JVM option.

    • maxNumConnections

      @Nullable default @Nullable Integer maxNumConnections()
      Returns the default server-side maximum number of connections. Note that this flag has no effect if a user specified the value explicitly via ServerBuilder.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

      @Nullable default @Nullable Integer 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 via ServerBuilder.workerGroup(EventLoopGroup, boolean) or ClientFactoryBuilder.workerGroup(EventLoopGroup, boolean).

      The default value of this flag is 2 * <numCpuCores>. Specify the -Dcom.linecorp.armeria.numCommonWorkers=<integer> JVM option to override the default value.

    • numCommonBlockingTaskThreads

      @Nullable default @Nullable Integer 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 via ServerBuilder.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

      @Nullable default @Nullable 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 via ServerBuilder.maxRequestLength(long).

      The default value of this flag is 10485760L. Specify the -Dcom.linecorp.armeria.defaultMaxRequestLength=<long> to override the default value. 0 disables the length limit.

    • defaultMaxResponseLength

      @Nullable default @Nullable 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 via ClientBuilder.maxResponseLength(long).

      The default value of this flag is 10485760L. Specify the -Dcom.linecorp.armeria.defaultMaxResponseLength=<long> to override the default value. 0 disables the length limit.

    • defaultRequestTimeoutMillis

      @Nullable default @Nullable 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 via ServerBuilder.requestTimeout(Duration).

      The default value of this flag is 10000L. Specify the -Dcom.linecorp.armeria.defaultRequestTimeoutMillis=<long> to override the default value. 0 disables the timeout.

    • defaultResponseTimeoutMillis

      @Nullable default @Nullable 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 via ClientBuilder.responseTimeout(Duration).

      The default value of this flag is 15000L. Specify the -Dcom.linecorp.armeria.defaultResponseTimeoutMillis=<long> to override the default value. 0 disables the timeout.

    • defaultConnectTimeoutMillis

      @Nullable default @Nullable 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 via ClientFactoryBuilder.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

      @Nullable default @Nullable 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 via ClientBuilder.writeTimeout(Duration).

      The default value of this flag is 1000L. Specify the -Dcom.linecorp.armeria.defaultWriteTimeoutMillis=<integer> JVM option to override the default value. 0 disables the timeout.

    • defaultServerIdleTimeoutMillis

      @Nullable default @Nullable 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 via ServerBuilder.idleTimeout(Duration).

      The default value of this flag is 15000L. Specify the -Dcom.linecorp.armeria.defaultServerIdleTimeoutMillis=<integer> JVM option to override the default value.

    • defaultClientIdleTimeoutMillis

      @Nullable default @Nullable 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 via ClientFactoryBuilder.idleTimeout(Duration).

      This default value of this flag is 10000L. Specify the -Dcom.linecorp.armeria.defaultClientIdleTimeoutMillis=<integer> JVM option to override the default value.

    • defaultHttp1MaxInitialLineLength

      @Nullable default @Nullable Integer 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 via ServerBuilder.http1MaxInitialLineLength(int) or ClientFactoryBuilder.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

      @Nullable default @Nullable Integer 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 via ServerBuilder.http1MaxHeaderSize(int) or ClientFactoryBuilder.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

      @Nullable default @Nullable Integer 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 via ServerBuilder.http1MaxChunkSize(int) or ClientFactoryBuilder.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

      @Nullable default @Nullable Boolean defaultUseHttp2Preface()
      Returns the default value of the ClientFactoryBuilder.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 the OPTIONS * HTTP/1.1 upgrade request. If disabled, the OPTIONS * HTTP/1.1 request 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 does not affect ciphertext HTTP/2 connections, which use ALPN for protocol negotiation, and it has no effect if a user specified the value explicitly via ClientFactoryBuilder.useHttp2Preface(boolean).

      This flag is enabled by default. Specify the -Dcom.linecorp.armeria.defaultUseHttp2Preface=false JVM option to disable it.

    • defaultUseHttp2WithoutAlpn

      @Nullable @UnstableApi default @Nullable Boolean defaultUseHttp2WithoutAlpn()
      Returns the default value of the ClientFactoryBuilder.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 on ClientFactoryBuilder.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=true JVM option to enable it.

    • defaultUseHttp1Pipelining

      @Nullable default @Nullable Boolean defaultUseHttp1Pipelining()
      Returns the default value of the ClientFactoryBuilder.useHttp1Pipelining(boolean) option. Note that this flag has no effect if a user specified the value explicitly via ClientFactoryBuilder.useHttp1Pipelining(boolean).

      This flag is disabled by default. Specify the -Dcom.linecorp.armeria.defaultUseHttp1Pipelining=true JVM option to enable it.

    • defaultPingIntervalMillis

      @Nullable default @Nullable 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 and defaultClientIdleTimeoutMillis() 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

      @Nullable default @Nullable Integer 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. 0 disables the limit.

    • defaultMaxClientNumRequestsPerConnection

      @Nullable default @Nullable Integer 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. 0 disables the limit.

    • defaultMaxServerConnectionAgeMillis

      @Nullable default @Nullable 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 than 0, 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

      @Nullable default @Nullable 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 than 0, 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

      @Nullable default @Nullable Long defaultServerConnectionDrainDurationMicros()
      Returns the default server-side graceful connection shutdown drain duration in microseconds. If the value of this flag is greater than 0, 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:
    • defaultHttp2InitialConnectionWindowSize

      @Nullable default @Nullable Integer defaultHttp2InitialConnectionWindowSize()
      Returns the default value of the ServerBuilder.http2InitialConnectionWindowSize(int) and ClientFactoryBuilder.http2InitialConnectionWindowSize(int) option. Note that this flag has no effect if a user specified the value explicitly via ServerBuilder.http2InitialConnectionWindowSize(int) or ClientFactoryBuilder.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

      @Nullable default @Nullable Integer defaultHttp2InitialStreamWindowSize()
      Returns the default value of the ServerBuilder.http2InitialStreamWindowSize(int) and ClientFactoryBuilder.http2InitialStreamWindowSize(int) option. Note that this flag has no effect if a user specified the value explicitly via ServerBuilder.http2InitialStreamWindowSize(int) or ClientFactoryBuilder.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

      @Nullable default @Nullable Integer defaultHttp2MaxFrameSize()
      Returns the default value of the ServerBuilder.http2MaxFrameSize(int) and ClientFactoryBuilder.http2MaxFrameSize(int) option. Note that this flag has no effect if a user specified the value explicitly via ServerBuilder.http2MaxFrameSize(int) or ClientFactoryBuilder.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

      @Nullable default @Nullable Long defaultHttp2MaxStreamsPerConnection()
      Returns the default value of the ServerBuilder.http2MaxStreamsPerConnection(long) option. Note that this flag has no effect if a user specified the value explicitly via ServerBuilder.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

      @Nullable default @Nullable Long defaultHttp2MaxHeaderListSize()
      Returns the default value of the ServerBuilder.http2MaxHeaderListSize(long) and ClientFactoryBuilder.http2MaxHeaderListSize(long) option. Note that this flag has no effect if a user specified the value explicitly via ServerBuilder.http2MaxHeaderListSize(long) or ClientFactoryBuilder.http2MaxHeaderListSize(long).

      The default value of this flag is 8192L. Specify the -Dcom.linecorp.armeria.defaultHttp2MaxHeaderListSize=<integer> JVM option to override the default value.

    • defaultBackoffSpec

      @Nullable default @Nullable String defaultBackoffSpec()
      Returns the Backoff specification string of the default Backoff returned by Backoff.ofDefault(). Note that this flag has no effect if a user specified the Backoff explicitly.

      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

      @Nullable default @Nullable Integer 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 a RetryingClient or a RetryingRpcClient.

      The default value of this flag is 10. Specify the -Dcom.linecorp.armeria.defaultMaxTotalAttempts=<integer> JVM option to override the default value.

    • defaultRequestAutoAbortDelayMillis

      @UnstableApi @Nullable default @Nullable Long defaultRequestAutoAbortDelayMillis()
      Returns the amount of time to wait by default before aborting an HttpRequest when its corresponding HttpResponse is complete. Note that this flag has no effect if a user specified the value explicitly via ServerBuilder.requestAutoAbortDelayMillis(long) or ClientBuilder.requestAutoAbortDelayMillis(long).
    • routeCacheSpec

      @Nullable default @Nullable String routeCacheSpec()
      Returns the Caffeine specification string of the cache that stores the recent request routing history for all Services.

      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=off JVM option to disable it.

    • routeDecoratorCacheSpec

      @Nullable default @Nullable String 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=off JVM option to disable it.

    • parsedPathCacheSpec

      @Nullable default @Nullable String 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=off JVM option to disable it.

    • headerValueCacheSpec

      @Nullable default @Nullable String headerValueCacheSpec()
      Returns the Caffeine specification string of the cache that stores the recent results for converting a raw HTTP ASCII header value into a String. Only the header values whose corresponding header name is listed in cachedHeaders() 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=off JVM option to disable it.

    • cachedHeaders

      @Nullable default @Nullable List<String> cachedHeaders()
      Returns the list of HTTP header names whose corresponding values will be cached, as specified in headerValueCacheSpec(). 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

      @Nullable default @Nullable String fileServiceCacheSpec()
      Returns the Caffeine specification string of the cache that stores the content of the HttpFiles read by a FileService. This value is used as the default of FileServiceBuilder.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=off JVM option to disable it.

    • dnsCacheSpec

      @Nullable default @Nullable String 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 of DnsResolverGroupBuilder.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.

    • preferredIpV4Addresses

      @Nullable default @Nullable Predicate<InetAddress> preferredIpV4Addresses()
      Returns the Predicate that is used to choose the non-loopback IP v4 address in SystemInfo.defaultNonLoopbackIpV4Address().

      This flag by default returns a Predicate that always returns true, which means all valid IPv4 addresses are preferred. Specify the -Dcom.linecorp.armeria.preferredIpV4Addresses=<csv> JVM option to override the default value. The csv should 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

      @Nullable default @Nullable Boolean useJdkDnsResolver()
      Enables DefaultAddressResolverGroup that 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 a DnsNameResolverTimeoutException.

      This flag is disabled by default. Specify the -Dcom.linecorp.armeria.useJdkDnsResolver=true JVM option to enable it.

    • reportBlockedEventLoop

      @Nullable default @Nullable Boolean reportBlockedEventLoop()
      Returns whether CompletableFutures returned by Armeria methods log a warning if CompletableFuture.join() or CompletableFuture.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. using thenApply() type methods to execute asynchronously or running the logic using ServiceRequestContext.blockingTaskExecutor().

      This flag is enabled by default. Specify the -Dcom.linecorp.armeria.reportBlockedEventLoop=false JVM option to disable it.

    • reportMaskedRoutes

      @Nullable default @Nullable Boolean reportMaskedRoutes()
      Returns whether to log a warning if a ServiceWithRoutes is added to a ServerBuilder using the methods that requires a path pattern, such as ServerBuilder.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

      @Nullable default @Nullable 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=false JVM option to disable it.

    • tlsAllowUnsafeCiphers

      @Nullable default @Nullable 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 via ClientFactoryBuilder.tlsAllowUnsafeCiphers(boolean).

      This flag is disabled by default. Specify the -Dcom.linecorp.armeria.tlsAllowUnsafeCiphers=true JVM option to enable it.

    • transientServiceOptions

      @Nullable default @Nullable Set<TransientServiceOption> transientServiceOptions()
      Returns the Set of TransientServiceOptions that are enabled for a TransientService.

      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

      @Nullable default @Nullable Boolean useDefaultSocketOptions()
      Returns whether default socket options defined by Armeria are enabled. If enabled, the following socket options are set automatically when /dev/epoll or io_uring is in use:
      • TCP_USER_TIMEOUT
      • TCP_KEEPIDLE
      • TCP_KEEPINTVL

      This flag is enabled by default. Specify the -Dcom.linecorp.armeria.useDefaultSocketOptions=false JVM option to disable it.

    • useLegacyRouteDecoratorOrdering

      @Nullable default @Nullable 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:
      
       Server server =
           Server.builder()
                 .service("/users", userService)
                 .decoratorUnder("/", loggingDecorator)
                 .decoratorUnder("/", authDecorator)
                 .decoratorUnder("/", traceDecorator)
                 .build();
       
      A request will go through the below decorators' order to reach the userService. request -> loggingDecorator -> authDecorator -> traceDecorator -> userService
    • allowDoubleDotsInQueryString

      @Nullable default @Nullable 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=true JVM option to enable it.

    • defaultMultipartUploadsLocation

      @Nullable default @Nullable Path defaultMultipartUploadsLocation()
      Returns the Path that is used to store the files uploaded from multipart/form-data requests.
    • requestContextLeakDetectionSampler

      @UnstableApi @Nullable default @Nullable Sampler<? super RequestContext> requestContextLeakDetectionSampler()
      Returns the Sampler that 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 if Sampler.never() is specified. See Sampler.of(String) for the specification string format.

    • meterRegistry

      @Nullable @UnstableApi default @Nullable MeterRegistry meterRegistry()
      Returns the MeterRegistry where armeria records metrics to by default.

      The default value of this flag is Metrics.globalRegistry.

    • defaultUnhandledExceptionsReportIntervalMillis

      @Nullable @UnstableApi default @Nullable Long defaultUnhandledExceptionsReportIntervalMillis()
      Returns the default interval in milliseconds between the reports on unhandled exceptions.

      The default value of this flag is 10000L. Specify the -Dcom.linecorp.armeria.defaultUnhandledExceptionsReportIntervalMillis=<long> JVM option to override the default value.