You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Daniel Kulp <dk...@apache.org> on 2009/10/12 22:38:55 UTC

Provider payload mode and streaming and 2.2.x compatibility....

Last week, I mentioned starting some work on getting some streaming support 
for incoming messages for Provider endpoints.   I have this working now for 
Provider<SAXSource> which is cool.    I have also wired in the java 6 
"StAXSource" (when running on Java6 or have a VERY recent xml apis with it in 
on the classpath) as well as our own StaxSource (which is a subclass of 
SAXSource which is how the SAXSource now streams) wired in.   

The question is, what should be sent in for Provider<Source>?

Previously, we always sent in a DOMSource.   The basic reason was that for all 
the Source things, we pretty much had to copy the entire message in anyway and 
DOMSource gave us the best performance.    With the new streaming support 
though, it probably makes sense to send in the cxf StaxSource thing.   This 
issue is that that would break existing apps that may expect a DOMSource.

One other thing I've done, I've added a configuration property:
"source-preferred-format"   
which can be set to:
"dom" -> DOMSource
"sax" -> SAXSource  (cxf StaxSource)
"stream" -> StreamSource
"cxf.stax" ->  StaxSource
"stax" -> javax.xml.transform.stax.StAXSource if avail, StaxSource otherwise

Thus, the question really is, what should the DEFAULT be if unspecified.  
"dom" for compatibility or "sax" for streaming performance?  For 2.3, I'm 
definitely thinking "sax" and a note added to the migration guide.   Thus, the 
question is more for 2.2.5.    

I'm kind of interested to hear from users to hear if flipping from dom to sax 
would break people.

THAT said, I also have schema-validation working with Provider things (which 
is why I was in this area of code to begin with).   In those cases, we still 
read to DOM so we can validate without consuming the stream.    With 2.3 we 
COULD use the schema validation stuff built into woodstox 4 and not do the DOM 
thing, but for 2.2.x, using DOM is easiest.

Anyway, I'd like to hear peoples thoughts.

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Re: Provider payload mode and streaming and 2.2.x compatibility....

Posted by Benson Margulies <bi...@gmail.com>.
Obvious stupid q: does metro or any other comparative RI take a position?

On Mon, Oct 12, 2009 at 4:38 PM, Daniel Kulp <dk...@apache.org> wrote:

>
> Last week, I mentioned starting some work on getting some streaming support
> for incoming messages for Provider endpoints.   I have this working now for
> Provider<SAXSource> which is cool.    I have also wired in the java 6
> "StAXSource" (when running on Java6 or have a VERY recent xml apis with it
> in
> on the classpath) as well as our own StaxSource (which is a subclass of
> SAXSource which is how the SAXSource now streams) wired in.
>
> The question is, what should be sent in for Provider<Source>?
>
> Previously, we always sent in a DOMSource.   The basic reason was that for
> all
> the Source things, we pretty much had to copy the entire message in anyway
> and
> DOMSource gave us the best performance.    With the new streaming support
> though, it probably makes sense to send in the cxf StaxSource thing.   This
> issue is that that would break existing apps that may expect a DOMSource.
>
> One other thing I've done, I've added a configuration property:
> "source-preferred-format"
> which can be set to:
> "dom" -> DOMSource
> "sax" -> SAXSource  (cxf StaxSource)
> "stream" -> StreamSource
> "cxf.stax" ->  StaxSource
> "stax" -> javax.xml.transform.stax.StAXSource if avail, StaxSource
> otherwise
>
> Thus, the question really is, what should the DEFAULT be if unspecified.
> "dom" for compatibility or "sax" for streaming performance?  For 2.3, I'm
> definitely thinking "sax" and a note added to the migration guide.   Thus,
> the
> question is more for 2.2.5.
>
> I'm kind of interested to hear from users to hear if flipping from dom to
> sax
> would break people.
>
> THAT said, I also have schema-validation working with Provider things
> (which
> is why I was in this area of code to begin with).   In those cases, we
> still
> read to DOM so we can validate without consuming the stream.    With 2.3 we
> COULD use the schema validation stuff built into woodstox 4 and not do the
> DOM
> thing, but for 2.2.x, using DOM is easiest.
>
> Anyway, I'd like to hear peoples thoughts.
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
>