Hi,

I tried using the StreamingOutput and it did not work either.
But I stepped through the code and found an interesting piece in the CXF HTTP 
Transport:
org.apache.cxf.transport.http.AbstractHTTPDestination.WrappedOutputStream

        public void flush() throws IOException {
            //ignore until we close
            // or we'll force chunking and cause all kinds of network packets
        }

This is part of the class the StreamingOutput gets as parameter in its write 
method.

Regards,
Thorsten

Am 08.06.2012 19:39, schrieb Daniel Kulp:
> Well, I know why it's NOT working.....   With the PipedIn/Out things, CXF 
> pretty much sits in a loop reading from the InputStream and writing to the 
> HTTP OutputStream.   Since there is no way to know that you requested a 
> "flush" in there, that loop just loops until the close at which point it 
> would flush and close the output.   
>
> You may need to wait for Sergey to be back next week, but you COULD look at 
> returning a "StreamingOutput" object where you could get the raw 
> OutputStream and do the periodic writes as needed.     With my few minutes 
> of research, that's what I came up with.  :-)   Sergey may have better 
> ideas.
>
> Dan
>
>
> On Friday, June 08, 2012 01:47:07 PM Thorsten Höger wrote:
>> Hi,
>>
>> I'm currently devloping a REST API for our software and I need streaming
>> functionality.
>>
>> I'm using CXF with Jetty and wiring with Spring.
>>
>> I tried it with the attached code, but if I do a curl on the address ti
>> blocks until Message 5 and the prints all lines.
>>
>> I expected it to print each line on its own with 1 second break.
>>
>> Can anybody give me a hint what I am doing wrong?
>>
>> Regards and thanks
>>
>> Thorsten

Reply via email to