|
@@ -13,6 +13,7 @@ import io.undertow.Handlers;
|
|
import io.undertow.Undertow;
|
|
import io.undertow.Undertow;
|
|
import io.undertow.UndertowOptions;
|
|
import io.undertow.UndertowOptions;
|
|
import io.undertow.util.Headers;
|
|
import io.undertow.util.Headers;
|
|
|
|
+import org.xnio.Options;
|
|
|
|
|
|
import javax.sql.DataSource;
|
|
import javax.sql.DataSource;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
@@ -115,10 +116,11 @@ public final class HelloWebServer {
|
|
}
|
|
}
|
|
Undertow.builder()
|
|
Undertow.builder()
|
|
.addListener(
|
|
.addListener(
|
|
- Integer.parseInt(properties.getProperty("web.port")),
|
|
|
|
- properties.getProperty("web.host"))
|
|
|
|
|
|
+ Integer.parseInt(properties.getProperty("web.port")),
|
|
|
|
+ properties.getProperty("web.host"))
|
|
.setBufferSize(1024 * 16)
|
|
.setBufferSize(1024 * 16)
|
|
.setIoThreads(Runtime.getRuntime().availableProcessors() * 2) //this seems slightly faster in some configurations
|
|
.setIoThreads(Runtime.getRuntime().availableProcessors() * 2) //this seems slightly faster in some configurations
|
|
|
|
+ .setSocketOption(Options.BACKLOG, 10000)
|
|
.setServerOption(UndertowOptions.ALWAYS_SET_KEEP_ALIVE, false) //don't send a keep-alive header for HTTP/1.1 requests, as it is not required
|
|
.setServerOption(UndertowOptions.ALWAYS_SET_KEEP_ALIVE, false) //don't send a keep-alive header for HTTP/1.1 requests, as it is not required
|
|
.setHandler(Handlers.date(Handlers.header(Handlers.path()
|
|
.setHandler(Handlers.date(Handlers.header(Handlers.path()
|
|
.addPrefixPath("/json",
|
|
.addPrefixPath("/json",
|