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

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


Originally, I posted this question on StackOverflow but couldn't get an

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

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.