Skip to content

Commit

Permalink
Rely on Java 11 and old bc version
Browse files Browse the repository at this point in the history
Log thread-pool on bootstrap phase with DEBUG logging level
  • Loading branch information
enricovianello committed Mar 18, 2024
1 parent 863517b commit 3d8227f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<plugin.license.version>1.9.0</plugin.license.version>
<plugin.jacoco.version>0.8.8</plugin.jacoco.version>

<java.version>17</java.version>
<java.version>11</java.version>

<!-- Keep this aligned with the parent project version! -->
<spring-boot.version>2.7.18</spring-boot.version>
Expand All @@ -55,7 +55,7 @@

<spring-security-oauth2.version>2.3.3.RELEASE</spring-security-oauth2.version>
<mock-server.version>5.5.1</mock-server.version>
<bouncycastle.version>1.76</bouncycastle.version>
<bouncycastle.version>1.72</bouncycastle.version>
<voms-api-java.version>3.3.2</voms-api-java.version>

<start-class>org.italiangrid.storm.webdav.WebdavService</start-class>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

import org.italiangrid.storm.webdav.config.ServiceConfiguration;
import org.italiangrid.storm.webdav.server.util.ThreadPoolBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.boot.web.embedded.jetty.JettyServerCustomizer;
import org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory;
Expand All @@ -27,6 +29,8 @@
public class DefaultWebServerFactory
implements WebServerFactoryCustomizer<JettyServletWebServerFactory> {

public static final Logger LOG = LoggerFactory.getLogger(DefaultWebServerFactory.class);

final ServiceConfiguration configuration;
final ServerProperties serverProperties;
final MetricRegistry metricRegistry;
Expand All @@ -45,14 +49,17 @@ public DefaultWebServerFactory(ServiceConfiguration configuration,
@Override
public void customize(JettyServletWebServerFactory factory) {

factory.setThreadPool(ThreadPoolBuilder.instance()
ThreadPoolBuilder threadPoolBuilder = ThreadPoolBuilder.instance()
.withMaxRequestQueueSize(configuration.getMaxQueueSize())
.withMaxThreads(configuration.getMaxConnections())
.withMinThreads(configuration.getMinConnections())
.registry(metricRegistry)
.withPrefix("storm.http")
.withName("thread-pool")
.build());
.withName("thread-pool");

LOG.debug("{}", threadPoolBuilder);

factory.setThreadPool(threadPoolBuilder.build());

factory.addServerCustomizers(serverCustomizer);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,11 @@ public ThreadPool build() {
return tp;

}

@Override
public String toString() {
return "ThreadPoolBuilder [maxThreads=" + maxThreads + ", minThreads=" + minThreads
+ ", idleTimeout=" + idleTimeout + ", maxRequestQueueSize=" + maxRequestQueueSize
+ ", name=" + name + ", prefix=" + prefix + ", registry=" + registry + "]";
}
}

0 comments on commit 3d8227f

Please sign in to comment.