What Freeman describes below isn't the FULL story. Normally, even with a single large attachment, nothing would be written to disk. Whenever possible, CXF tries to stream things directly. In the case of a single attachment, or the last attachment when using multiple attachments, CXF can stream directly and thus it wouldn't normally create the files on disk.
However, when any of the cases that force the attachment to be fully realized occurs and breaks the streaming, it would automatically buffer them into the files on disk like Freeman describes. Dan On Sunday 24 April 2011 11:36:01 PM Freeman Fang wrote: > Hi, > > My comment inline > > On 2011-4-25, at 上午11:16, ext2 wrote: > > Hi: > > Sometimes, web service (both service and client) need to receive > > very large attachment. > > > > 1) does cxf support save large attachment in temporary file for > > > > service to receive request , and client to receive response? > > Yeah, > When cxf message exceed a threshold(64 k by default), it will save the > memory message to temp file on hard disk(by default it save to the > folder specified by a pre-set well-known java system properties > java.io.tempdir + cxf-temp-random ). > > > 2)how could I configure the temporary directory and threshold? > > You can specify the threshold with property > org.apache.cxf.io.CachedOutputStream.Threshold (64k by default) t > and specify the cxf temp dir for big size message with property > org.apache.cxf.io.CachedOutputStream.OutputDirectory > to a folder you have full acesss permission. > Freeman > > > > > > > --------------------------------------------- > Freeman Fang > > FuseSource > Email:[email protected] > Web: fusesource.com > Twitter: freemanfang > Blog: http://freemanfang.blogspot.com > Connect at CamelOne May 24-26 > The Open Source Integration Conference -- Daniel Kulp [email protected] http://dankulp.com/blog Talend - http://www.talend.com
