java - Setting worker threads for undertow server -
I am trying to customize the overhough server and I set the I / O thread (WORKER_IO_THREADS and WORKER_TASK_CORE_THREADS) Want to try HttpListener Can you please help me with the necessary steps?
Below server = Undertow.Builder (). AddHttpListener (80, "") .setHandler (new HTTP handler () {Public Zero Handle Request (Last HttpServerExchange Exchange) Exception {String String_change = Exchange .getQueryString (); str = & lt; String; Some works on Exchange; Exchange GateresSansSender (). Send (strip);}}). Build (); Server.start ();
I have read that the XNIO worker associated with the listener needs to be configured. Although I am not clear on how to go about it.
I'm afraid that you need to take a long way to bootstrap as described manually below have been shown. The reason for this is that all handlers share the NIO pool with an XnioWorker.
XnioWorker worker = xnio.createWorker (OptionMap.builder () .set (Options.WORKER_IO_THREADS, ioThreads) .set (option. WORKER_TASK_CORE_THREADS, worker threads) Kset (option. WORKER_TASK_MAX_THREADS, Work Threads ). Set (option. TCP_NOADA, true) .getMap ());
Comments
Post a Comment