Jetty, where are my five threads?

Viewed 2732

I'm using spring+jetty. I'm configuring jetty:

@Bean
public JettyEmbeddedServletContainerFactory jettyEmbeddedServletContainerFactory() {
    final JettyEmbeddedServletContainerFactory factory = new JettyEmbeddedServletContainerFactory(port);
    factory.addServerCustomizers((Server server) -> {
        final QueuedThreadPool threadPool = server.getBean(QueuedThreadPool.class);
        threadPool.setMinThreads(minThreads);
        threadPool.setMaxThreads(maxThreads);
        threadPool.setIdleTimeout(1000);
    });
    return factory;
}

It works, but strange.

  1. Set minThreads=1, maxThreads=5, and it doesn't processing connections.
  2. Set minThreads=1, maxThreads=6, and it processing only one connection
  3. Set minThreads=1, maxThreads=7, and it processing only two connections. When I say processing, I mean, that it accepts connections, but do nothing. Doesn't reply, doesn't abort them. (I think they are in a queue)

So, where are my 5 threads?

1 Answers
Related