- Adding a property to specify the size of the Jetty thread pool.
This commit is contained in:
Matt Gilman 2014-12-31 10:42:42 -05:00
parent ebf3cdc779
commit 3c5bb56386
4 changed files with 9 additions and 1 deletions

View File

@ -294,6 +294,7 @@
<nifi.web.https.host />
<nifi.web.https.port />
<nifi.jetty.work.dir>./work/jetty</nifi.jetty.work.dir>
<nifi.web.jetty.threads>200</nifi.web.jetty.threads>
<!-- nifi.properties: security properties -->
<nifi.security.keystore />

View File

@ -137,6 +137,7 @@ public class NiFiProperties extends Properties {
public static final String WEB_HTTPS_PORT = "nifi.web.https.port";
public static final String WEB_HTTPS_HOST = "nifi.web.https.host";
public static final String WEB_WORKING_DIR = "nifi.web.jetty.working.directory";
public static final String WEB_THREADS = "nifi.web.jetty.threads";
// ui properties
public static final String UI_BANNER_TEXT = "nifi.ui.banner.text";
@ -182,6 +183,7 @@ public class NiFiProperties extends Properties {
public static final String DEFAULT_USER_CREDENTIAL_CACHE_DURATION = "24 hours";
public static final Integer DEFAULT_REMOTE_INPUT_PORT = null;
public static final Path DEFAULT_TEMPLATE_DIRECTORY = Paths.get("conf", "templates");
public static final int DEFAULT_WEB_THREADS = 200;
public static final String DEFAULT_WEB_WORKING_DIR = "./work/jetty";
public static final String DEFAULT_NAR_WORKING_DIR = "./work/nar";
public static final String DEFAULT_COMPONENT_DOCS_DIRECTORY = "./work/docs/components";
@ -499,6 +501,10 @@ public class NiFiProperties extends Properties {
return sslPort;
}
public int getWebThreads() {
return getIntegerProperty(WEB_THREADS, DEFAULT_WEB_THREADS);
}
public File getWebWorkingDirectory() {
return new File(getProperty(WEB_WORKING_DIR, DEFAULT_WEB_WORKING_DIR));
}

View File

@ -102,6 +102,7 @@ nifi.web.http.port=${nifi.web.http.port}
nifi.web.https.host=${nifi.web.https.host}
nifi.web.https.port=${nifi.web.https.port}
nifi.web.jetty.working.directory=${nifi.jetty.work.dir}
nifi.web.jetty.threads=${nifi.web.jetty.threads}
# security properties #
nifi.sensitive.props.key=

View File

@ -108,7 +108,7 @@ public class JettyServer implements NiFiServer {
* @param props the configuration
*/
public JettyServer(final NiFiProperties props) {
final QueuedThreadPool threadPool = new QueuedThreadPool();
final QueuedThreadPool threadPool = new QueuedThreadPool(props.getWebThreads());
threadPool.setName("NiFi Web Server");
// create the server