On Oct 9, 2013, at 6:58 AM, Chun Tat David Chu <beyonddc.storage_at_gmail.com> wrote:
> Hi All,
>
> I am trying to get ChunkedOutput to work using Tomcat 7. My test code is very similar to what's available on the tutorial website. https://jersey.java.net/documentation/latest/async.html#chunked-output
What is the difference between your code and the tutorial?
>
> I tried with both command line curl and a Java application that follows ChunkedInput tutorial https://jersey.java.net/documentation/latest/async.html#d0e7470
>
> By observing the behavior, it appears to me that my Java application is not receiving the chunked output whenever my web service is invoking chunkedOutput.write(). Instead all the chunked output is received at once after all the write is completed.
It appears to me as though you are not using a separate thread to write the chunked data and trying to write all the chunks BEFORE you return your chunked output. Is that the case?
In order order to receive new chunks immediately, you must first return the chunked output from your method and only then start writing new chunks.
Marek
>
> Any one tried using ChunkedOutput with Tomcat 7? Is there anything that I must configure? or I need to use a different web server?
>
> Thanks!
>
> David
>