diff --git a/src/main/java/io/sinistral/proteus/Application.java b/src/main/java/io/sinistral/proteus/Application.java index 029d216..7b0c510 100644 --- a/src/main/java/io/sinistral/proteus/Application.java +++ b/src/main/java/io/sinistral/proteus/Application.java @@ -193,24 +193,24 @@ public Undertow buildServer() { handler = rootHandler; } - + undertow = Undertow.builder() .addHttpListener(config.getInt("application.port"),config.getString("application.host")) - .setServerOption(UndertowOptions.ENABLE_HTTP2, config.getBoolean("undertow.server.enableHttp2")) - .setServerOption(UndertowOptions.ALWAYS_SET_DATE, config.getBoolean("undertow.server.alwaysSetDate")) + .setBufferSize(config.getBytes("undertow.bufferSize").intValue()) + .setIoThreads(config.getInt("undertow.ioThreads")) + .setServerOption(UndertowOptions.ENABLE_HTTP2, config.getBoolean("undertow.server.enableHttp2")) + .setServerOption(UndertowOptions.ALWAYS_SET_DATE, true) .setServerOption(UndertowOptions.BUFFER_PIPELINED_DATA, config.getBoolean("undertow.server.bufferPipelinedData")) + .setSocketOption(org.xnio.Options.BACKLOG, config.getInt("undertow.socket.backlog")) .setServerOption(UndertowOptions.ALWAYS_SET_KEEP_ALIVE, config.getBoolean("undertow.server.alwaysSetKeepAlive")) .setServerOption(UndertowOptions.RECORD_REQUEST_START_TIME, config.getBoolean("undertow.server.recordRequestStartTime")) .setServerOption(UndertowOptions.MAX_ENTITY_SIZE, config.getBytes("undertow.server.maxEntitySize") ) - .setSocketOption(org.xnio.Options.BACKLOG, config.getInt("undertow.socket.backlog")) .setWorkerThreads(config.getInt("undertow.workerThreads")) - .setBufferSize(config.getBytes("undertow.bufferSize").intValue()) - .setIoThreads(config.getInt("undertow.ioThreads")) .setDirectBuffers( config.getBoolean("undertow.directBuffers")) + .setHandler( handler ) .build(); - return undertow; } diff --git a/src/main/resources/reference.conf b/src/main/resources/reference.conf index 3d59de6..ebe9c56 100644 --- a/src/main/resources/reference.conf +++ b/src/main/resources/reference.conf @@ -73,11 +73,11 @@ swagger { undertow { server { - enableHttp2 = false + enableHttp2 = true alwaysSetDate = true alwaysSetKeepAlive = false recordRequestStartTime = false - maxEntitySize = 200M + maxEntitySize = 100M bufferPipelinedData = false } @@ -85,10 +85,10 @@ undertow backlog = 10000 } # x AvailableProcessors - ioThreads = 8 + ioThreads = 12 workerThreads = 200 bufferSize = 16K - directBuffers = false + directBuffers = true } \ No newline at end of file