Bael 770 jetty (#1629)

* BAEL-770 add jetty simple test case

* BAEL-770 jetty async and blocking servlets

* BAEL-766 reorder

* increment version

* configuration thread pool
This commit is contained in:
Tomasz Lelek 2017-04-10 15:10:33 +02:00 committed by adamd1985
parent 34aa697a02
commit 3fd20f6479
2 changed files with 31 additions and 1 deletions

View File

@ -117,6 +117,26 @@
<artifactId>commons-io</artifactId>
<version>${commons.io.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons.io.version}</version>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-core</artifactId>
@ -144,6 +164,9 @@
<assertj.version>3.6.2</assertj.version>
<jsonassert.version>1.5.0</jsonassert.version>
<javers.version>3.1.0</javers.version>
<jetty.version>9.4.3.v20170317</jetty.version>
<httpclient.version>4.5.3</httpclient.version>
<commons.io.version>2.5</commons.io.version>
<jetty.version>9.4.2.v20170220</jetty.version>
<httpclient.version>4.5.3</httpclient.version>
<commons.io.version>2.5</commons.io.version>

View File

@ -4,6 +4,7 @@ import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.servlet.ServletHandler;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
public class JettyServer {
@ -11,7 +12,13 @@ public class JettyServer {
public void start() throws Exception {
server = new Server();
int maxThreads = 100;
int minThreads = 10;
int idleTimeout = 120;
QueuedThreadPool threadPool = new QueuedThreadPool(maxThreads, minThreads, idleTimeout);
server = new Server(threadPool);
ServerConnector connector = new ServerConnector(server);
connector.setPort(8090);
server.setConnectors(new Connector[]{connector});