Skip to main content

dawdler-boot-web-tomcat

Module Introduction​

Implementation of the embedded tomcat container.

1. Usage​

Add the following to pom.xml:

<dependencies>
<dependency>
<groupId>club.dawdler</groupId>
<artifactId>dawdler-boot-web-tomcat</artifactId>
</dependency>
</dependencies>

2. Configuration​

tomcat.yml, located under resources.

tomcat:
#virtual-thread # whether to use virtual threads, false by default
#max-threads: # maximum number of threads, not effective when virtual-thread is true
#min-spare-threads: # minimum number of spare threads, not effective when virtual-thread is true
#max-queue-size: # maximum queue size, not effective when virtual-thread is true
#accept-count: # request queue length
#max-connections: # maximum number of connections
#max-header-count: # maximum number of request headers
#connection-timeout: # connection timeout in milliseconds
#keep-alive-timeout: # Keep-Alive timeout in milliseconds
#graceful-shutdown-response-timeout: 3000 # during graceful shutdown, other requests return 503 within this wait time, in milliseconds, 3000 by default; if set to 0, new requests are rejected immediately
#max-concurrent-requests: # maximum number of concurrent requests being processed; requests over the limit are rejected with a 503 status code. Not enabled when empty or 0, empty by default
#tomcat-options: # configuration under tomcat, generally not needed; for custom configuration refer to org.apache.coyote.http11.Http11NioProtocol.java
#maxKeepAliveRequests: 100

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}
prefix: access_log. # log prefix
suffix: log # log suffix
dir: logs # log directory
rotate: true # log rotation

3. Switching from undertow​

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.