cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mustafa Sezgin" <msez...@aconex.com>
Subject RE: CXF and large XML request/responses : streaming support?
Date Wed, 23 Dec 2009 03:46:52 GMT
I have the need to stream large XML responses back to the client using 
Jax-RS. We have a large number of objects (Potentially upto a million) which 
need to be marshalled and the response returned, is the support for 
streaming XML responses while objects are being marshalled in CXF at the 
moment? We are currently seeing some large degradation in performance at 
times when these large number of entities are being marshalled.

I basically return the objects which need to be marshalled from our Service 
methods, what would need to change for me to be able to make use of the 
streaming support?

-----Original Message-----
From: Sergey Beryozkin [mailto:sberyozk@progress.com]
Sent: Friday, 9 October 2009 11:12 PM
To: users@cxf.apache.org
Cc: rsmith
Subject: Re: CXF and large XML request/responses : streaming support?

Hi

> It is interesting, especially the Stax support.I'm not familiar with the
> recent build of CXF, on this matter would it be also available for the
> JAX-RS support.

I missed it...I think in the case of JAXRS declaring a method accepting 
(JAXP) Source will work once
I update a SourceProvider to check if XMLStreamReader is available on the 
message (or create a new one if it is a multipart request)
and then wrap it in StaxSource and just pass it on - will be done for 2.3; 
if you need it working now then I can help you with
creating a custom SourceProvider...The existing MultipartProvider will just 
delegate to it.

thanks, Sergey

>
> Anyway great framework :)
>
>
> On Thu, Oct 8, 2009 at 19:29, Daniel Kulp <dkulp@apache.org> wrote:
>
>>
>> Right now, with a JAX-WS provider, there is SOME support for this, but 
>> its
>> far
>> from ideal.   This is an area I'll be working in next week (resolving
>> customer
>> issues) and I'll see if I can add some enhancements easily enough.
>>
>> Basically, right now, if you do Provider<Source>, you would get 
>> DOMSource
>> in
>> (thus, the incoming message would not be streamed, but you could return a
>> StreamSource or SAXSource orsimilar to use that we would use to copy 
>> stuff
>> out.    If you did Provider<StreamSource> or Provider<SAXSource>, we
pull
>> the
>> full message into a Cached stream (which, for large messages, would 
>> output
>> to
>> temp files on disks) and return that to you.   Thus, the whole thing 
>> isn't
>> in
>> memory, but it does result in the temp files and such.
>>
>> Part of what I hope to do next week is enable:
>> Provider<XMLStreamReader>
>> and/or
>> Provider<StaxSource>
>> which would allow full streaming in most cases.
>>
>> Dan
>>
>>
>>
>> On Wed October 7 2009 12:37:50 am rsmith wrote:
>> > I'm trying to find out if CXF supports full streaming of input and 
>> > output
>> > messages for the SOAP transport.
>> >
>> > I have a service that will be receiving large input XML payload, and 
>> > will
>> >  be generating a response with a large XML payload.  I can process the
>> >  input XML incrementally, generating the response as the input is
>> >  processed.
>> >
>> > Is there a way to implement a service in CXF streaming at all levels 
>> > (XML
>> > parsing, data binding, generating response), avoiding holding the full
>> > document in memory at any time?
>> >
>> > I found several threads on the mailing list, some of which make it 
>> > sound
>> > like it's supported.  This message gave me the impression it may not
>> > currently be supported though:
>> >
>> http://www.nabble.com/Re%3A-Configuring-streaming-web-services%3A-error-on-
>> > the-call-to-invoke-p24187339.html
>> >
>> > Some of the other threads:
>> >
>> http://www.nabble.com/Looking-for-a-solution-for-Large-XML-Messages---strea
>> > ming-and-JAXWS-td20451942.html#a20451942
>> >
>> http://www.nabble.com/Recommended-way-to-have-a-web-method-stream-results-
>> > back-to-client--td22856243.html#a22864087
>> >  http://www.nabble.com/SAXSource-td24411461.html#a24411461
>> >
>> > Thanks in advance
>> >
>>
>> --
>> Daniel Kulp
>> dkulp@apache.org
>> http://www.dankulp.com/blog
>>
>
>
>
> -- 
> Bryce
>


Mime
View raw message