use of org.springframework.boot.web.embedded.jetty.JettyWebServer in project spring-boot by spring-projects.
the class JettyWebServerFactoryCustomizerTests method threadPoolWithMaxQueueCapacityEqualToZeroCreateSynchronousQueue.
@Test
void threadPoolWithMaxQueueCapacityEqualToZeroCreateSynchronousQueue() {
bind("server.jetty.threads.max-queue-capacity=0");
JettyWebServer server = customizeAndGetServer();
ThreadPool threadPool = server.getServer().getThreadPool();
BlockingQueue<?> queue = getQueue(threadPool);
assertThat(queue).isInstanceOf(SynchronousQueue.class);
assertDefaultThreadPoolSettings(threadPool);
}
use of org.springframework.boot.web.embedded.jetty.JettyWebServer in project spring-boot by spring-projects.
the class JettyWebServerFactoryCustomizerTests method threadPoolIdleTimeoutCanBeCustomized.
@Test
void threadPoolIdleTimeoutCanBeCustomized() {
bind("server.jetty.threads.idle-timeout=100s");
JettyWebServer server = customizeAndGetServer();
QueuedThreadPool threadPool = (QueuedThreadPool) server.getServer().getThreadPool();
assertThat(threadPool.getIdleTimeout()).isEqualTo(100000);
}
use of org.springframework.boot.web.embedded.jetty.JettyWebServer in project spring-boot by spring-projects.
the class JettyWebServerFactoryCustomizerTests method customMaxHttpHeaderSizeIgnoredIfZero.
@Test
void customMaxHttpHeaderSizeIgnoredIfZero() {
bind("server.max-http-header-size=0");
JettyWebServer server = customizeAndGetServer();
List<Integer> requestHeaderSizes = getRequestHeaderSizes(server);
assertThat(requestHeaderSizes).containsOnly(8192);
}
use of org.springframework.boot.web.embedded.jetty.JettyWebServer in project spring-boot by spring-projects.
the class JettyWebServerFactoryCustomizerTests method customizeMaxHttpHeaderSize.
@Test
void customizeMaxHttpHeaderSize() {
bind("server.max-http-header-size=2048");
JettyWebServer server = customizeAndGetServer();
List<Integer> requestHeaderSizes = getRequestHeaderSizes(server);
assertThat(requestHeaderSizes).containsOnly(2048);
}
use of org.springframework.boot.web.embedded.jetty.JettyWebServer in project spring-boot by spring-projects.
the class JettyWebServerFactoryCustomizerTests method threadPoolWithMaxQueueCapacityPositiveCustomizesThreadPool.
@Test
void threadPoolWithMaxQueueCapacityPositiveCustomizesThreadPool() {
bind("server.jetty.threads.max-queue-capacity=1234", "server.jetty.threads.min=10", "server.jetty.threads.max=150", "server.jetty.threads.idle-timeout=3s");
JettyWebServer server = customizeAndGetServer();
QueuedThreadPool threadPool = (QueuedThreadPool) server.getServer().getThreadPool();
assertThat(threadPool.getMinThreads()).isEqualTo(10);
assertThat(threadPool.getMaxThreads()).isEqualTo(150);
assertThat(threadPool.getIdleTimeout()).isEqualTo(Duration.ofSeconds(3).toMillis());
}
Aggregations