Class ArmeriaSettings

java.lang.Object
com.linecorp.armeria.spring.ArmeriaSettings

@ConfigurationProperties(prefix="armeria") @Validated public class ArmeriaSettings extends Object
Settings for armeria servers. For example:

 armeria:
   ports:
     - port: 8080
       protocols: HTTP
     - address: 127.0.0.1
       port: 8081
       protocols: HTTP
     - port: 8443
       protocols: HTTPS
   ssl:
     key-alias: "host.name.com"
     key-store: "keystore.jks"
     key-store-password: "changeme"
     trust-store: "truststore.jks"
     trust-store-password: "changeme"
   compression:
     enabled: true
     mime-types: text/*, application/json
     excluded-user-agents: some-user-agent, another-user-agent
     min-response-size: 1KB
   internal-services:
     port: 18080
     include: docs, health, metrics
   enable-auto-injection: true
 
  • Constructor Details

    • ArmeriaSettings

      public ArmeriaSettings()
  • Method Details

    • getPorts

      public List<ArmeriaSettings.Port> getPorts()
      Returns the ArmeriaSettings.Ports of the Server.
    • setPorts

      public void setPorts(List<ArmeriaSettings.Port> ports)
      Sets the ArmeriaSettings.Ports of the Server.
    • getContextPath

      @Nullable public @Nullable String getContextPath()
      Returns the context path of the Server.
    • setContextPath

      public void setContextPath(String contextPath)
      Sets the context path to serve the requests on. If not set, requests will be served on the root context path.
    • getHealthCheckPath

      @Nullable public @Nullable String getHealthCheckPath()
      Returns the path of the HealthCheckService.
    • setHealthCheckPath

      public void setHealthCheckPath(@Nullable @Nullable String healthCheckPath)
      Sets the path of the HealthCheckService.
    • getDocsPath

      @Nullable public @Nullable String getDocsPath()
      Returns the path of the DocService.
    • setDocsPath

      public void setDocsPath(@Nullable @Nullable String docsPath)
      Sets the path of the DocService.
    • getMetricsPath

      @Nullable public @Nullable String getMetricsPath()
      Returns the path of the metrics exposition service. PrometheusExpositionService will be used if armeria-prometheus1 module is added. Otherwise, Dropwizard's MetricsModule will be used if DropwizardMeterRegistry is available.
    • setMetricsPath

      public void setMetricsPath(@Nullable @Nullable String metricsPath)
      Sets the path of the metrics exposition service. PrometheusExpositionService will be used if armeria-prometheus1 module is added. Otherwise, Dropwizard's MetricsModule will be used if DropwizardMeterRegistry is available.
    • setInternalServices

      public void setInternalServices(ArmeriaSettings.InternalServiceProperties internalServices)
      Sets the properties of internal services that should not be exposed to the external network.
    • getInternalServices

      @Nullable public @Nullable ArmeriaSettings.InternalServiceProperties getInternalServices()
      Returns the properties of internal services that should not be exposed to the external network.
    • getGracefulShutdownQuietPeriodMillis

      public long getGracefulShutdownQuietPeriodMillis()
      Returns the number of milliseconds to wait for active requests to go end before shutting down.
      See Also:
    • setGracefulShutdownQuietPeriodMillis

      public void setGracefulShutdownQuietPeriodMillis(long gracefulShutdownQuietPeriodMillis)
      Sets the number of milliseconds to wait for active requests to go end before shutting down.
      See Also:
    • getGracefulShutdownTimeoutMillis

      public long getGracefulShutdownTimeoutMillis()
      Returns the number of milliseconds to wait before shutting down the server regardless of active requests.
      See Also:
    • setGracefulShutdownTimeoutMillis

      public void setGracefulShutdownTimeoutMillis(long gracefulShutdownTimeoutMillis)
      Sets the number of milliseconds to wait before shutting down the server regardless of active requests.
      See Also:
    • isEnableMetrics

      public boolean isEnableMetrics()
      Returns whether to enable metrics exposition service at the path specified via setMetricsPath(String).
    • setEnableMetrics

      public void setEnableMetrics(boolean enableMetrics)
      Sets whether to enable metrics exposition service at the path specified via setMetricsPath(String).
    • getSsl

      @Nullable public @Nullable Ssl getSsl()
      Returns the Ssl configuration that the Server uses.
    • setSsl

      public void setSsl(Ssl ssl)
      Sets the Ssl configuration that the Server uses.
    • getCompression

      @Nullable public @Nullable ArmeriaSettings.Compression getCompression()
      Returns the HTTP content encoding configuration that the Server uses.
    • setCompression

      public void setCompression(ArmeriaSettings.Compression compression)
      Sets the HTTP content encoding configuration that the Server uses.
    • getWorkerGroup

      @Nullable public @Nullable Integer getWorkerGroup()
      Returns the number of threads for EventLoopGroup that the Server uses.
    • setWorkerGroup

      public void setWorkerGroup(@Nullable @Nullable Integer workerGroup)
      Sets the number of threads for EventLoopGroup that the Server uses.
    • getBlockingTaskExecutor

      @Nullable public @Nullable Integer getBlockingTaskExecutor()
      Returns the number of threads dedicated to the execution of blocking tasks or invocations.
    • setBlockingTaskExecutor

      public void setBlockingTaskExecutor(@Nullable @Nullable Integer blockingTaskExecutor)
      Sets the number of threads dedicated to the execution of blocking tasks or invocations.
    • getMaxNumConnections

      @Nullable public @Nullable Integer getMaxNumConnections()
      Returns the maximum allowed number of open connections.
    • setMaxNumConnections

      public void setMaxNumConnections(@Nullable @Nullable Integer maxNumConnections)
      Sets the maximum allowed number of open connections.
    • getIdleTimeout

      @Nullable public @Nullable Duration getIdleTimeout()
      Returns the idle timeout of a connection for keep-alive.
    • setIdleTimeout

      public void setIdleTimeout(@Nullable @Nullable Duration idleTimeout)
      Sets the idle timeout of a connection for keep-alive.
    • getPingInterval

      @Nullable public @Nullable Duration getPingInterval()
      Returns the interval of the HTTP/2 PING frame.
    • setPingInterval

      public void setPingInterval(@Nullable @Nullable Duration pingInterval)
      Sets the interval of the HTTP/2 PING frame.
    • getMaxConnectionAge

      @Nullable public @Nullable Duration getMaxConnectionAge()
      Returns the maximum allowed age of a connection for keep-alive.
    • setMaxConnectionAge

      public void setMaxConnectionAge(@Nullable @Nullable Duration maxConnectionAge)
      Sets the maximum allowed age of a connection for keep-alive.
    • getMaxNumRequestsPerConnection

      @Nullable public @Nullable Integer getMaxNumRequestsPerConnection()
      Returns the maximum allowed number of requests that can be served through one connection.
    • setMaxNumRequestsPerConnection

      public void setMaxNumRequestsPerConnection(@Nullable @Nullable Integer maxNumRequestsPerConnection)
      Sets the maximum allowed number of requests that can be served through one connection.
    • getHttp2InitialConnectionWindowSize

      @Nullable public @Nullable String getHttp2InitialConnectionWindowSize()
      Returns the initial connection-level HTTP/2 flow control window size.
    • setHttp2InitialConnectionWindowSize

      public void setHttp2InitialConnectionWindowSize(@Nullable @Nullable String http2InitialConnectionWindowSize)
      Sets the initial connection-level HTTP/2 flow control window size.
    • getHttp2InitialStreamWindowSize

      @Nullable public @Nullable String getHttp2InitialStreamWindowSize()
      Returns the initial stream-level HTTP/2 flow control window size.
    • setHttp2InitialStreamWindowSize

      public void setHttp2InitialStreamWindowSize(@Nullable @Nullable String http2InitialStreamWindowSize)
      Sets the initial stream-level HTTP/2 flow control window size.
    • getHttp2MaxStreamsPerConnection

      @Nullable public @Nullable Long getHttp2MaxStreamsPerConnection()
      Returns the maximum number of concurrent streams per HTTP/2 connection.
    • setHttp2MaxStreamsPerConnection

      public void setHttp2MaxStreamsPerConnection(@Nullable @Nullable Long http2MaxStreamsPerConnection)
      Sets the maximum number of concurrent streams per HTTP/2 connection.
    • getHttp2MaxFrameSize

      @Nullable public @Nullable String getHttp2MaxFrameSize()
      Returns the maximum size of HTTP/2 frame that can be received.
    • setHttp2MaxFrameSize

      public void setHttp2MaxFrameSize(@Nullable @Nullable String http2MaxFrameSize)
      Sets the maximum size of HTTP/2 frame that can be received.
    • getHttp2MaxHeaderListSize

      @Nullable public @Nullable String getHttp2MaxHeaderListSize()
      Returns the maximum size of headers that can be received.
    • setHttp2MaxHeaderListSize

      public void setHttp2MaxHeaderListSize(@Nullable @Nullable String http2MaxHeaderListSize)
      Sets the maximum size of headers that can be received.
    • getHttp1MaxInitialLineLength

      @Nullable public @Nullable String getHttp1MaxInitialLineLength()
      Returns the maximum length of an HTTP/1 response initial line.
    • setHttp1MaxInitialLineLength

      public void setHttp1MaxInitialLineLength(@Nullable @Nullable String http1MaxInitialLineLength)
      Sets the maximum length of an HTTP/1 response initial line.
    • getHttp1MaxHeaderSize

      @Nullable public @Nullable String getHttp1MaxHeaderSize()
      Returns the maximum length of all headers in an HTTP/1 response.
    • setHttp1MaxHeaderSize

      public void setHttp1MaxHeaderSize(@Nullable @Nullable String http1MaxHeaderSize)
      Sets the maximum length of all headers in an HTTP/1 response.
    • getHttp1MaxChunkSize

      @Nullable public @Nullable String getHttp1MaxChunkSize()
      Returns the maximum length of each chunk in an HTTP/1 response content.
    • setHttp1MaxChunkSize

      public void setHttp1MaxChunkSize(@Nullable @Nullable String http1MaxChunkSize)
      Sets the maximum length of each chunk in an HTTP/1 response content.
    • getAccessLog

      @Nullable public @Nullable ArmeriaSettings.AccessLog getAccessLog()
      Returns the Server's access log configuration.
    • setAccessLog

      public void setAccessLog(@Nullable @Nullable ArmeriaSettings.AccessLog accessLog)
      Sets the Server's access log configuration.
    • getAccessLogger

      @Nullable public @Nullable String getAccessLogger()
      Returns the default access logger name for all VirtualHosts.
    • setAccessLogger

      public void setAccessLogger(@Nullable @Nullable String accessLogger)
      Sets the default access logger name for all VirtualHosts.
    • getRequestTimeout

      @Nullable public @Nullable Duration getRequestTimeout()
      Returns the timeout of a request.
    • setRequestTimeout

      public void setRequestTimeout(@Nullable @Nullable Duration requestTimeout)
      Sets the timeout of a request.
    • getMaxRequestLength

      @Nullable public @Nullable String getMaxRequestLength()
      Returns the maximum allowed length of the content decoded at the session layer.
    • setMaxRequestLength

      public void setMaxRequestLength(@Nullable @Nullable String maxRequestLength)
      Sets the maximum allowed length of the content decoded at the session layer.
    • getVerboseResponses

      @Nullable public @Nullable Boolean getVerboseResponses()
      Returns whether the verbose response mode is enabled.
    • setVerboseResponses

      public void setVerboseResponses(@Nullable @Nullable Boolean verboseResponses)
      Sets whether the verbose response mode is enabled.
    • isEnableAutoInjection

      public boolean isEnableAutoInjection()
      Returns whether to apply SpringDependencyInjector automatically.
    • setEnableAutoInjection

      public void setEnableAutoInjection(boolean enableAutoInjection)
      Sets whether to apply SpringDependencyInjector automatically.