diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java index 6af30b33ceb..8448dc0eaef 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java @@ -956,7 +956,7 @@ public class ServerProperties { /** * Maximum thread idle time. */ - private Duration idleTimeout = Duration.ofMillis(60000); + private Duration threadIdleTimeout = Duration.ofMillis(60000); /** * Time that the connection can be idle before it is closed. @@ -1007,12 +1007,12 @@ public class ServerProperties { return this.maxThreads; } - public void setIdleTimeout(Duration idleTimeout) { - this.idleTimeout = idleTimeout; + public void setThreadIdleTimeout(Duration threadIdleTimeout) { + this.threadIdleTimeout = threadIdleTimeout; } - public Duration getIdleTimeout() { - return this.idleTimeout; + public Duration getThreadIdleTimeout() { + return this.threadIdleTimeout; } public Duration getConnectionIdleTimeout() { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/JettyWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/JettyWebServerFactoryCustomizer.java index 053e871fc3a..bae39ec9c1d 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/JettyWebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/JettyWebServerFactoryCustomizer.java @@ -86,7 +86,7 @@ public class JettyWebServerFactoryCustomizer .to((maxThreads) -> customizeThreadPool(factory, (threadPool) -> threadPool.setMaxThreads(maxThreads))); propertyMapper.from(jettyProperties::getMinThreads).when(this::isPositive) .to((minThreads) -> customizeThreadPool(factory, (threadPool) -> threadPool.setMinThreads(minThreads))); - propertyMapper.from(jettyProperties::getIdleTimeout).whenNonNull().asInt(Duration::toMillis).to( + propertyMapper.from(jettyProperties::getThreadIdleTimeout).whenNonNull().asInt(Duration::toMillis).to( (idleTimeout) -> customizeThreadPool(factory, (threadPool) -> threadPool.setIdleTimeout(idleTimeout))); propertyMapper.from(properties::getConnectionTimeout).whenNonNull() .to((connectionTimeout) -> customizeIdleTimeout(factory, connectionTimeout)); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java index db8260ff8a6..2e81a382f24 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java @@ -233,8 +233,8 @@ class ServerPropertiesTests { @Test void testCustomizeJettyIdleTimeout() { - bind("server.jetty.idle-timeout", "10s"); - assertThat(this.properties.getJetty().getIdleTimeout()).isEqualTo(Duration.ofSeconds(10)); + bind("server.jetty.thread-idle-timeout", "10s"); + assertThat(this.properties.getJetty().getThreadIdleTimeout()).isEqualTo(Duration.ofSeconds(10)); } @Test diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/embedded/JettyWebServerFactoryCustomizerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/embedded/JettyWebServerFactoryCustomizerTests.java index eafd337ef7a..118dd8bf3c2 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/embedded/JettyWebServerFactoryCustomizerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/embedded/JettyWebServerFactoryCustomizerTests.java @@ -134,8 +134,8 @@ class JettyWebServerFactoryCustomizerTests { } @Test - void idleTimeoutCanBeCustomized() { - bind("server.jetty.idle-timeout=100s"); + void threadIdleTimeoutCanBeCustomized() { + bind("server.jetty.thread-idle-timeout=100s"); JettyWebServer server = customizeAndGetServer(); QueuedThreadPool threadPool = (QueuedThreadPool) server.getServer().getThreadPool(); assertThat(threadPool.getIdleTimeout()).isEqualTo(100000);