<div dir="ltr">I am writing a server that will need to respond to lots of small web requests. Most of the requests will come with a small POST payload. Based on the contents of the payload, the server will either a) respond immediately, or b) forward the request as is to one of a pool of backend servers, waiting for a response and forwarding the response back to the client.<div><br></div><div>It looks like given the existing undertow code, I have good examples of how to forward requests to the backend. What isn&#39;t as clear is how to handle the getting the POST data. Is there a way of doing that without blocking?</div><div><br></div><div>Ideally, my handler flow would be:</div><div><br></div><div>1. Non-blocking request handler that makes sure all POST data is in.</div><div>2. A non-blocking handler that decisions based on content of POST data to</div><div>3a. Immediately return a response to the client (non-blocking).</div><div>or</div><div>3b. Dispatch to the worker pool to forward request to backend server and await response.</div><div><br></div><div>90% of my requests will go through path 3a, and I&#39;d like that to be as quick as possible. When the server decides a request should go through 3b, only then should it go to the blocking worker pool.</div><div><br></div><div>Am I viewing this correctly? What are my options? Based on this thread </div><div><a href="http://lists.jboss.org/pipermail/undertow-dev/2015-January/001082.html">http://lists.jboss.org/pipermail/undertow-dev/2015-January/001082.html</a></div><div>it seems like an option could be to get the request channel in step 1 above? Its not clear to me how that would work.</div><div><br></div><div>Thanks,</div><div>Chris</div></div>