I've been using servlet 3.0 async processing using Jetty 9.0.6.v20130930 quite nicely- able to handle 7k+ concurrent connections on commodity hardware. Now that Jetty 9.1 is GA, I'm trying to use async IO on top of async processing.
Essentially, in my worker thread which processes async context, instead of directly writing to output stream, I've set WriteListener which in turn writes to output stream. The problem is that after processing few requests, Jetty is not accepting new connections- it kind of hangs. Existing client connections eventually time out.
Is there a sample code available somewhere which shows how to use async processing with async IO?
asyncContext.getResponse().getWriter().printf("ticker: %s, price: %.2f", ticker, price);
and replacing it with
ServletOutputStream out = response.getOutputStream();
but as I mentioned, after processing few requests, Jetty becomes unresponsive.
Any pointers on how to resolve this issue?
Thanks in advance,