JAX-RS ChunkedOutput and ChunkedInput Example

You may also like...

Notify of
1 Comment
Inline Feedbacks
View all comments
Robert Whent
Robert Whent
November 21, 2018 17:29

I’ve had issues with ChunkedOutput not being fully thread safe even though flushQueue() has some synchronization. What can happen is that the thread returning the ChunkedOutput class to the server can attempt to read and flush the queue at the same time as the thread performing the work to write the chunks, writes and flushes the queue. The result is that one of the threads assumes it should close the stream an subsequent writes fail with an EOF exception. In order to overcome this issue I needed to derive a class and override the offending functions. import java.lang.reflect.Type; import javax.ws.rs.container.ConnectionCallback;… Read more »

Would love your thoughts, please comment.x