Skip to content

Commit 1b40b0e

Browse files
committed
Polish contribution
Closes gh-15054
1 parent 3059f0e commit 1b40b0e

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizer.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,13 @@ private void customizeAcceptCount(ConfigurableTomcatWebServerFactory factory,
136136
});
137137
}
138138

139+
private void customizeProcessorCache(ConfigurableTomcatWebServerFactory factory,
140+
int processorCache) {
141+
factory.addConnectorCustomizers((
142+
connector) -> ((AbstractHttp11Protocol<?>) connector.getProtocolHandler())
143+
.setProcessorCache(processorCache));
144+
}
145+
139146
private void customizeMaxConnections(ConfigurableTomcatWebServerFactory factory,
140147
int maxConnections) {
141148
factory.addConnectorCustomizers((connector) -> {
@@ -158,13 +165,6 @@ private void customizeConnectionTimeout(ConfigurableTomcatWebServerFactory facto
158165
});
159166
}
160167

161-
private void customizeProcessorCache(ConfigurableTomcatWebServerFactory factory,
162-
int processorCache) {
163-
factory.addConnectorCustomizers((
164-
connector) -> ((AbstractHttp11Protocol<?>) connector.getProtocolHandler())
165-
.setProcessorCache(processorCache));
166-
}
167-
168168
private void customizeRemoteIpValve(ConfigurableTomcatWebServerFactory factory) {
169169
Tomcat tomcatProperties = this.serverProperties.getTomcat();
170170
String protocolHeader = tomcatProperties.getProtocolHeader();

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,12 @@ public void tomcatAcceptCountMatchesProtocolDefault() throws Exception {
206206
.isEqualTo(getDefaultProtocol().getAcceptCount());
207207
}
208208

209+
@Test
210+
public void tomcatProcessorCacheMatchesProtocolDefault() throws Exception {
211+
assertThat(this.properties.getTomcat().getProcessorCache())
212+
.isEqualTo(getDefaultProtocol().getProcessorCache());
213+
}
214+
209215
@Test
210216
public void tomcatMaxConnectionsMatchesProtocolDefault() throws Exception {
211217
assertThat(this.properties.getTomcat().getMaxConnections())

spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ content into your application. Rather, pick only the properties that you need.
276276
server.tomcat.max-threads=200 # Maximum amount of worker threads.
277277
server.tomcat.min-spare-threads=10 # Minimum amount of worker threads.
278278
server.tomcat.port-header=X-Forwarded-Port # Name of the HTTP header used to override the original port value.
279-
server.tomcat.processor-cache= # Maximum number of idle processors that will be retained in the cache and reused with a subsequent request.
279+
server.tomcat.processor-cache=200 # Maximum number of idle processors that will be retained in the cache and reused with a subsequent request.
280280
server.tomcat.protocol-header= # Header that holds the incoming protocol, usually named "X-Forwarded-Proto".
281281
server.tomcat.protocol-header-https-value=https # Value of the protocol header indicating whether the incoming request uses SSL.
282282
server.tomcat.redirect-context-root=true # Whether requests to the context root should be redirected by appending a / to the path.

0 commit comments

Comments
 (0)