cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <>
Subject Provider<Source> payload mode and streaming and 2.2.x compatibility....
Date Mon, 12 Oct 2009 20:38:55 GMT

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:
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

View raw message