users@jax-rs-spec.java.net

[jax-rs-spec users] Handling HTTP request-response exchange asynchronously in JAX-RS

From: Donghwan Kim <flowersinthesand_at_gmail.com>
Date: Mon, 17 Nov 2014 18:20:24 +0900

Hi,

Originally, I posted this question on StackOverflow but couldn't get an
answer:
http://stackoverflow.com/questions/26955663/handling-http-request-response-exchange-asynchronously-in-jax-rs

If I write what I need as propositions:

   - A server should be able to read chunk from request body without
   blocking every time a client writes and flushes that chunk like Servlet
   3.1's ServletInputStream#setReadListener.
   - A server should be able to write and flush chunk multiple times to
   response body without blocking like Servlet 3.0's
   HttpServletRequest#startAsync.

With JAX-RS 2.0, I couldn't meet them. For the first one, I couldn't find
such support like ReadListener, and for the second one, I found
AsyncResponse but its API doesn't allow writing chunk multiple times.

Is there any idea or hack to meet them with only JAX-RS API not using
implementation-specific features? I tried ContainerRequestFilter,
ContainerResponseFilter, ReaderInterceptor and WriterInterceptor, but they
didn't help.

Thanks,

--Donghwan