Package com.linecorp.armeria.spring
Class ArmeriaSettings
java.lang.Object
com.linecorp.armeria.spring.ArmeriaSettings
Settings for armeria servers. For example:
armeria:
ports:
- port: 8080
protocol: HTTP
- ip: 127.0.0.1
port: 8081
protocol:HTTP
- port: 8443
protocol: 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
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Configurations for the access log.static class
Configurations for the HTTP content encoding.static class
Properties for internal services such asDocService
,PrometheusExpositionService
, andHealthCheckService
.static class
Port and protocol settings. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns theServer
's access log configuration.Returns the default access logger name for allVirtualHost
s.Returns the number of threads dedicated to the execution of blocking tasks or invocations.Returns the HTTP content encoding configuration that theServer
uses.Returns the path of theDocService
.long
Returns the number of milliseconds to wait for active requests to go end before shutting down.long
Returns the number of milliseconds to wait before shutting down the server regardless of active requests.Returns the path of theHealthCheckService
.Returns the maximum length of each chunk in an HTTP/1 response content.Returns the maximum length of all headers in an HTTP/1 response.Returns the maximum length of an HTTP/1 response initial line.Returns the initial connection-level HTTP/2 flow control window size.Returns the initial stream-level HTTP/2 flow control window size.Returns the maximum size of HTTP/2 frame that can be received.Returns the maximum size of headers that can be received.Returns the maximum number of concurrent streams per HTTP/2 connection.Returns the idle timeout of a connection for keep-alive.Returns the properties of internal services that should not be exposed to the external network.Returns the maximum allowed age of a connection for keep-alive.Returns the maximum allowed number of open connections.Returns the maximum allowed number of requests that can be served through one connection.Returns the maximum allowed length of the content decoded at the session layer.Returns the path of the metrics exposition service.Returns the interval of the HTTP/2 PING frame.getPorts()
Returns theArmeriaSettings.Port
s of theServer
.Returns the timeout of a request.getSsl()
Returns whether the verbose response mode is enabled.Returns the number of threads forEventLoopGroup
that theServer
uses.boolean
Returns whether to enable metrics exposition service at the path specified viasetMetricsPath(String)
.void
setAccessLog
(@Nullable ArmeriaSettings.AccessLog accessLog) Sets theServer
's access log configuration.void
setAccessLogger
(@Nullable String accessLogger) Sets the default access logger name for allVirtualHost
s.void
setBlockingTaskExecutor
(@Nullable Integer blockingTaskExecutor) Sets the number of threads dedicated to the execution of blocking tasks or invocations.void
setCompression
(ArmeriaSettings.Compression compression) Sets the HTTP content encoding configuration that theServer
uses.void
setDocsPath
(@Nullable String docsPath) Sets the path of theDocService
.void
setEnableMetrics
(boolean enableMetrics) Sets whether to enable metrics exposition service at the path specified viasetMetricsPath(String)
.void
setGracefulShutdownQuietPeriodMillis
(long gracefulShutdownQuietPeriodMillis) Sets the number of milliseconds to wait for active requests to go end before shutting down.void
setGracefulShutdownTimeoutMillis
(long gracefulShutdownTimeoutMillis) Sets the number of milliseconds to wait before shutting down the server regardless of active requests.void
setHealthCheckPath
(@Nullable String healthCheckPath) Sets the path of theHealthCheckService
.void
setHttp1MaxChunkSize
(@Nullable String http1MaxChunkSize) Sets the maximum length of each chunk in an HTTP/1 response content.void
setHttp1MaxHeaderSize
(@Nullable String http1MaxHeaderSize) Sets the maximum length of all headers in an HTTP/1 response.void
setHttp1MaxInitialLineLength
(@Nullable String http1MaxInitialLineLength) Sets the maximum length of an HTTP/1 response initial line.void
setHttp2InitialConnectionWindowSize
(@Nullable String http2InitialConnectionWindowSize) Sets the initial connection-level HTTP/2 flow control window size.void
setHttp2InitialStreamWindowSize
(@Nullable String http2InitialStreamWindowSize) Sets the initial stream-level HTTP/2 flow control window size.void
setHttp2MaxFrameSize
(@Nullable String http2MaxFrameSize) Sets the maximum size of HTTP/2 frame that can be received.void
setHttp2MaxHeaderListSize
(@Nullable String http2MaxHeaderListSize) Sets the maximum size of headers that can be received.void
setHttp2MaxStreamsPerConnection
(@Nullable Long http2MaxStreamsPerConnection) Sets the maximum number of concurrent streams per HTTP/2 connection.void
setIdleTimeout
(@Nullable Duration idleTimeout) Sets the idle timeout of a connection for keep-alive.void
setInternalServices
(ArmeriaSettings.InternalServiceProperties internalServices) Sets the properties of internal services that should not be exposed to the external network.void
setMaxConnectionAge
(@Nullable Duration maxConnectionAge) Sets the maximum allowed age of a connection for keep-alive.void
setMaxNumConnections
(@Nullable Integer maxNumConnections) Sets the maximum allowed number of open connections.void
setMaxNumRequestsPerConnection
(@Nullable Integer maxNumRequestsPerConnection) Sets the maximum allowed number of requests that can be served through one connection.void
setMaxRequestLength
(@Nullable String maxRequestLength) Sets the maximum allowed length of the content decoded at the session layer.void
setMetricsPath
(@Nullable String metricsPath) Sets the path of the metrics exposition service.void
setPingInterval
(@Nullable Duration pingInterval) Sets the interval of the HTTP/2 PING frame.void
setPorts
(List<ArmeriaSettings.Port> ports) Sets theArmeriaSettings.Port
s of theServer
.void
setRequestTimeout
(@Nullable Duration requestTimeout) Sets the timeout of a request.void
void
setVerboseResponses
(@Nullable Boolean verboseResponses) Sets whether the verbose response mode is enabled.void
setWorkerGroup
(@Nullable Integer workerGroup) Sets the number of threads forEventLoopGroup
that theServer
uses.
-
Constructor Details
-
ArmeriaSettings
public ArmeriaSettings()
-
-
Method Details
-
getPorts
Returns theArmeriaSettings.Port
s of theServer
. -
setPorts
Sets theArmeriaSettings.Port
s of theServer
. -
getHealthCheckPath
Returns the path of theHealthCheckService
. -
setHealthCheckPath
Sets the path of theHealthCheckService
. -
getDocsPath
Returns the path of theDocService
. -
setDocsPath
Sets the path of theDocService
. -
getMetricsPath
Returns the path of the metrics exposition service.PrometheusExpositionService
will be used ifPrometheusMeterRegistry
is available. Otherwise, Dropwizard'sMetricsModule
will be used ifDropwizardMeterRegistry
is available. -
setMetricsPath
Sets the path of the metrics exposition service.PrometheusExpositionService
will be used ifPrometheusMeterRegistry
is available. Otherwise, Dropwizard'sMetricsModule
will be used ifDropwizardMeterRegistry
is available. -
setInternalServices
Sets the properties of internal services that should not be exposed to the external network. -
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. -
setGracefulShutdownQuietPeriodMillis
public void setGracefulShutdownQuietPeriodMillis(long gracefulShutdownQuietPeriodMillis) Sets the number of milliseconds to wait for active requests to go end before shutting down. -
getGracefulShutdownTimeoutMillis
public long getGracefulShutdownTimeoutMillis()Returns the number of milliseconds to wait before shutting down the server regardless of active requests. -
setGracefulShutdownTimeoutMillis
public void setGracefulShutdownTimeoutMillis(long gracefulShutdownTimeoutMillis) Sets the number of milliseconds to wait before shutting down the server regardless of active requests. -
isEnableMetrics
public boolean isEnableMetrics()Returns whether to enable metrics exposition service at the path specified viasetMetricsPath(String)
. -
setEnableMetrics
public void setEnableMetrics(boolean enableMetrics) Sets whether to enable metrics exposition service at the path specified viasetMetricsPath(String)
. -
getSsl
-
setSsl
-
getCompression
Returns the HTTP content encoding configuration that theServer
uses. -
setCompression
Sets the HTTP content encoding configuration that theServer
uses. -
getWorkerGroup
Returns the number of threads forEventLoopGroup
that theServer
uses. -
setWorkerGroup
Sets the number of threads forEventLoopGroup
that theServer
uses. -
getBlockingTaskExecutor
Returns the number of threads dedicated to the execution of blocking tasks or invocations. -
setBlockingTaskExecutor
Sets the number of threads dedicated to the execution of blocking tasks or invocations. -
getMaxNumConnections
Returns the maximum allowed number of open connections. -
setMaxNumConnections
Sets the maximum allowed number of open connections. -
getIdleTimeout
Returns the idle timeout of a connection for keep-alive. -
setIdleTimeout
Sets the idle timeout of a connection for keep-alive. -
getPingInterval
Returns the interval of the HTTP/2 PING frame. -
setPingInterval
Sets the interval of the HTTP/2 PING frame. -
getMaxConnectionAge
Returns the maximum allowed age of a connection for keep-alive. -
setMaxConnectionAge
Sets the maximum allowed age of a connection for keep-alive. -
getMaxNumRequestsPerConnection
Returns the maximum allowed number of requests that can be served through one connection. -
setMaxNumRequestsPerConnection
Sets the maximum allowed number of requests that can be served through one connection. -
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
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
Returns the maximum number of concurrent streams per HTTP/2 connection. -
setHttp2MaxStreamsPerConnection
Sets the maximum number of concurrent streams per HTTP/2 connection. -
getHttp2MaxFrameSize
Returns the maximum size of HTTP/2 frame that can be received. -
setHttp2MaxFrameSize
Sets the maximum size of HTTP/2 frame that can be received. -
getHttp2MaxHeaderListSize
Returns the maximum size of headers that can be received. -
setHttp2MaxHeaderListSize
Sets the maximum size of headers that can be received. -
getHttp1MaxInitialLineLength
Returns the maximum length of an HTTP/1 response initial line. -
setHttp1MaxInitialLineLength
Sets the maximum length of an HTTP/1 response initial line. -
getHttp1MaxHeaderSize
Returns the maximum length of all headers in an HTTP/1 response. -
setHttp1MaxHeaderSize
Sets the maximum length of all headers in an HTTP/1 response. -
getHttp1MaxChunkSize
Returns the maximum length of each chunk in an HTTP/1 response content. -
setHttp1MaxChunkSize
Sets the maximum length of each chunk in an HTTP/1 response content. -
getAccessLog
Returns theServer
's access log configuration. -
setAccessLog
Sets theServer
's access log configuration. -
getAccessLogger
Returns the default access logger name for allVirtualHost
s. -
setAccessLogger
Sets the default access logger name for allVirtualHost
s. -
getRequestTimeout
Returns the timeout of a request. -
setRequestTimeout
Sets the timeout of a request. -
getMaxRequestLength
Returns the maximum allowed length of the content decoded at the session layer. -
setMaxRequestLength
Sets the maximum allowed length of the content decoded at the session layer. -
getVerboseResponses
Returns whether the verbose response mode is enabled. -
setVerboseResponses
Sets whether the verbose response mode is enabled.
-