title: Configuring maxKeepAliveRequests in Spring Boot embedded Tomcat
body: <p>I need to modify the maxKeepAliveRequests value in my Spring Boot Zuul gateway to a value higher than the default 100. Noting that this value is not exposed in Spring Boot's <a href="https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html" rel="nofollow noreferrer">common properties list</a>, I tried to set the property via @Configuration class instead:</p>
  
  <pre class="lang-java prettyprint-override"><code>@Configuration
  public class DefaultConfig {
      @Bean
      public EmbeddedServletContainerFactory servletContainerFactory() {
          TomcatEmbeddedServletContainerFactory factory = new TomcatEmbeddedServletContainerFactory();
  
          factory.addConnectorCustomizers(connector -&gt;
                  ((AbstractHttp11Protocol) connector.getProtocolHandler()).setMaxKeepAliveRequests(1000));
  
          return factory;
      }
  }
  </code></pre>
  
  <p>But it doesn't seem to take the desired effect. Is there a proper way for me to change Tomcat properties that are not exposed via Spring common properties?</p>