dawdler-boot-web-undertow
Module Introduction
Implementation of the embedded undertow container.
1. Usage
Add the following to pom.xml:
<dependencies>
<dependency>
<groupId>club.dawdler</groupId>
<artifactId>dawdler-boot-web-undertow</artifactId>
</dependency>
</dependencies>
2. Configuration
undertow.yml, located under resources.
undertow:
#io-threads: # number of I/O threads created for the worker, the default value derives from the number of available processors
#worker-threads: # number of worker threads, the default value is 8 times the number of I/O threads. Not effective when virtual-thread is true
#buffer-size: # size of each buffer in bytes, the default value derives from the maximum memory available to the JVM
#direct-buffers: # whether to enable off-heap buffers, enabled by default when the JVM size exceeds 64M
#virtual-thread: # whether to enable virtual threads, disabled by default
#undertow-options: # configuration under undertow, generally not needed; for custom configuration refer to UndertowOptions.java
#max_headers: 200 # maximum number of request headers
#socket-options: # socket configuration items, generally not needed, defaults are fine; for custom configuration refer to org.xnio.Options.java
#max-concurrent-requests: # requests over the limit are rejected with a 503 status code. Not enabled when empty or 0, empty by default
web-socket-byte-buffer-pool:
#direct: false
#buffer-size: 2048
#maximum-pool-size: -1
#thread-local-cache-size = 12
#leak-detection-percent = 0
static-resource: # static resource cache
cache-enabled: true # whether to enable the static resource cache, true by default. When disabled, the underlying ResourceManager is read directly, bypassing DirectBufferCache
cache-size: 10485760 # total direct-buffer memory available to the DirectBufferCache in bytes, 10485760 (10MB) by default. The value is converted into the corresponding number of buffer pages, used to cache hot static resources (CSS/JS/images, etc.)
max-file-size: 10485760 # upper limit of cacheable file size in bytes, 10485760 (10MB) by default. Files larger than this are not cached and are read directly from the underlying layer
metadata-cache-size: 100 # number of metadata cache entries, 100 by default. Used to cache resource metadata such as lastModified/contentLength
access-log: # access log
enabled: false # whether to enable the access log
pattern: common # log format common=%h %l %u %t %r %s %b combined=%h %l %u %t \"%r\" %s %b %{i,Referer} %{i,User-Agent} commonobf=%o %l %u %t %r %s %b combinedobf=%o %l %u %t %r %s %b %{i,Referer} %{i,User-Agent}
prefix: access_log. # log prefix
suffix: log # log suffix
dir: logs # log directory
rotate: true # log rotation
3. Switching from tomcat
dawdler-boot-web-tomcat and dawdler-boot-web-undertow cannot be imported at the same time; just import the dependency of the container you need.