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
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classConfigurations for the access log.static classConfigurations for the HTTP content encoding.static classProperties for internal services such asDocService,PrometheusExpositionService, andHealthCheckService.static classPort and protocol settings. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable ArmeriaSettings.AccessLogReturns theServer's access log configuration.@Nullable StringReturns the default access logger name for allVirtualHosts.@Nullable IntegerReturns the number of threads dedicated to the execution of blocking tasks or invocations.@Nullable ArmeriaSettings.CompressionReturns the HTTP content encoding configuration that theServeruses.@Nullable StringReturns the context path of theServer.@Nullable StringReturns the path of theDocService.longReturns the number of milliseconds to wait for active requests to go end before shutting down.longReturns the number of milliseconds to wait before shutting down the server regardless of active requests.@Nullable StringReturns the path of theHealthCheckService.@Nullable StringReturns the maximum length of each chunk in an HTTP/1 response content.@Nullable StringReturns the maximum length of all headers in an HTTP/1 response.@Nullable StringReturns the maximum length of an HTTP/1 response initial line.@Nullable StringReturns the initial connection-level HTTP/2 flow control window size.@Nullable StringReturns the initial stream-level HTTP/2 flow control window size.@Nullable StringReturns the maximum size of HTTP/2 frame that can be received.@Nullable StringReturns the maximum size of headers that can be received.@Nullable LongReturns the maximum number of concurrent streams per HTTP/2 connection.@Nullable DurationReturns the idle timeout of a connection for keep-alive.Returns the properties of internal services that should not be exposed to the external network.@Nullable DurationReturns the maximum allowed age of a connection for keep-alive.@Nullable IntegerReturns the maximum allowed number of open connections.@Nullable IntegerReturns the maximum allowed number of requests that can be served through one connection.@Nullable StringReturns the maximum allowed length of the content decoded at the session layer.@Nullable StringReturns the path of the metrics exposition service.@Nullable DurationReturns the interval of the HTTP/2 PING frame.getPorts()Returns theArmeriaSettings.Ports of theServer.@Nullable DurationReturns the timeout of a request.@Nullable SslgetSsl()Returns theSslconfiguration that theServeruses.@Nullable BooleanReturns whether the verbose response mode is enabled.@Nullable IntegerReturns the number of threads forEventLoopGroupthat theServeruses.booleanReturns whether to applySpringDependencyInjectorautomatically.booleanReturns whether to enable metrics exposition service at the path specified viasetMetricsPath(String).voidsetAccessLog(@Nullable ArmeriaSettings.AccessLog accessLog) Sets theServer's access log configuration.voidsetAccessLogger(@Nullable String accessLogger) Sets the default access logger name for allVirtualHosts.voidsetBlockingTaskExecutor(@Nullable Integer blockingTaskExecutor) Sets the number of threads dedicated to the execution of blocking tasks or invocations.voidsetCompression(ArmeriaSettings.Compression compression) Sets the HTTP content encoding configuration that theServeruses.voidsetContextPath(String contextPath) Sets the context path to serve the requests on.voidsetDocsPath(@Nullable String docsPath) Sets the path of theDocService.voidsetEnableAutoInjection(boolean enableAutoInjection) Sets whether to applySpringDependencyInjectorautomatically.voidsetEnableMetrics(boolean enableMetrics) Sets whether to enable metrics exposition service at the path specified viasetMetricsPath(String).voidsetGracefulShutdownQuietPeriodMillis(long gracefulShutdownQuietPeriodMillis) Sets the number of milliseconds to wait for active requests to go end before shutting down.voidsetGracefulShutdownTimeoutMillis(long gracefulShutdownTimeoutMillis) Sets the number of milliseconds to wait before shutting down the server regardless of active requests.voidsetHealthCheckPath(@Nullable String healthCheckPath) Sets the path of theHealthCheckService.voidsetHttp1MaxChunkSize(@Nullable String http1MaxChunkSize) Sets the maximum length of each chunk in an HTTP/1 response content.voidsetHttp1MaxHeaderSize(@Nullable String http1MaxHeaderSize) Sets the maximum length of all headers in an HTTP/1 response.voidsetHttp1MaxInitialLineLength(@Nullable String http1MaxInitialLineLength) Sets the maximum length of an HTTP/1 response initial line.voidsetHttp2InitialConnectionWindowSize(@Nullable String http2InitialConnectionWindowSize) Sets the initial connection-level HTTP/2 flow control window size.voidsetHttp2InitialStreamWindowSize(@Nullable String http2InitialStreamWindowSize) Sets the initial stream-level HTTP/2 flow control window size.voidsetHttp2MaxFrameSize(@Nullable String http2MaxFrameSize) Sets the maximum size of HTTP/2 frame that can be received.voidsetHttp2MaxHeaderListSize(@Nullable String http2MaxHeaderListSize) Sets the maximum size of headers that can be received.voidsetHttp2MaxStreamsPerConnection(@Nullable Long http2MaxStreamsPerConnection) Sets the maximum number of concurrent streams per HTTP/2 connection.voidsetIdleTimeout(@Nullable Duration idleTimeout) Sets the idle timeout of a connection for keep-alive.voidsetInternalServices(ArmeriaSettings.InternalServiceProperties internalServices) Sets the properties of internal services that should not be exposed to the external network.voidsetMaxConnectionAge(@Nullable Duration maxConnectionAge) Sets the maximum allowed age of a connection for keep-alive.voidsetMaxNumConnections(@Nullable Integer maxNumConnections) Sets the maximum allowed number of open connections.voidsetMaxNumRequestsPerConnection(@Nullable Integer maxNumRequestsPerConnection) Sets the maximum allowed number of requests that can be served through one connection.voidsetMaxRequestLength(@Nullable String maxRequestLength) Sets the maximum allowed length of the content decoded at the session layer.voidsetMetricsPath(@Nullable String metricsPath) Sets the path of the metrics exposition service.voidsetPingInterval(@Nullable Duration pingInterval) Sets the interval of the HTTP/2 PING frame.voidsetPorts(List<ArmeriaSettings.Port> ports) Sets theArmeriaSettings.Ports of theServer.voidsetRequestTimeout(@Nullable Duration requestTimeout) Sets the timeout of a request.voidSets theSslconfiguration that theServeruses.voidsetVerboseResponses(@Nullable Boolean verboseResponses) Sets whether the verbose response mode is enabled.voidsetWorkerGroup(@Nullable Integer workerGroup) Sets the number of threads forEventLoopGroupthat theServeruses.
-
Constructor Details
-
ArmeriaSettings
public ArmeriaSettings()
-
-
Method Details
-
getPorts
Returns theArmeriaSettings.Ports of theServer. -
setPorts
Sets theArmeriaSettings.Ports of theServer. -
getContextPath
Returns the context path of theServer. -
setContextPath
Sets the context path to serve the requests on. If not set, requests will be served on the root context path. -
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.PrometheusExpositionServicewill be used ifarmeria-prometheus1module is added. Otherwise, Dropwizard'sMetricsModulewill be used ifDropwizardMeterRegistryis available. -
setMetricsPath
Sets the path of the metrics exposition service.PrometheusExpositionServicewill be used ifarmeria-prometheus1module is added. Otherwise, Dropwizard'sMetricsModulewill be used ifDropwizardMeterRegistryis 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.- 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 viasetMetricsPath(String). -
setEnableMetrics
public void setEnableMetrics(boolean enableMetrics) Sets whether to enable metrics exposition service at the path specified viasetMetricsPath(String). -
getSsl
Returns theSslconfiguration that theServeruses. -
setSsl
Sets theSslconfiguration that theServeruses. -
getCompression
Returns the HTTP content encoding configuration that theServeruses. -
setCompression
Sets the HTTP content encoding configuration that theServeruses. -
getWorkerGroup
Returns the number of threads forEventLoopGroupthat theServeruses. -
setWorkerGroup
Sets the number of threads forEventLoopGroupthat theServeruses. -
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 allVirtualHosts. -
setAccessLogger
Sets the default access logger name for allVirtualHosts. -
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. -
isEnableAutoInjection
public boolean isEnableAutoInjection()Returns whether to applySpringDependencyInjectorautomatically. -
setEnableAutoInjection
public void setEnableAutoInjection(boolean enableAutoInjection) Sets whether to applySpringDependencyInjectorautomatically.
-