Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 99949 invoked from network); 26 Oct 2009 12:12:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Oct 2009 12:12:25 -0000 Received: (qmail 82672 invoked by uid 500); 26 Oct 2009 12:12:24 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 82594 invoked by uid 500); 26 Oct 2009 12:12:24 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 82584 invoked by uid 99); 26 Oct 2009 12:12:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Oct 2009 12:12:24 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of bimargulies@gmail.com designates 209.85.219.210 as permitted sender) Received: from [209.85.219.210] (HELO mail-ew0-f210.google.com) (209.85.219.210) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Oct 2009 12:12:20 +0000 Received: by ewy6 with SMTP id 6so8182383ewy.30 for ; Mon, 26 Oct 2009 05:11:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=tZhsRoMNcj2+S9KNvICl5/wg4QZdh3/bcy5JzHSj8Tc=; b=BjrK9ac451lsN8FkiOZ51/mXsXaxf2G1z/Jdxu0DrnBiecnSh8/Q4a9eCQIMeVhxoI aAahxnUhUvrLRRTZdJC10Hs/wuytbdpN4Wc7iNZZ2nuJIkchUIA9v2q0G+3PAueWbLEG u/PFlQLVN+gEgMAsmvaklQP/cPwMNiaiTdrTg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ByInpqhpvnG0iWU65JBH23qSQg5tc7Qxaj3bhAU6k7Ff4fL5kckVLHfACDv3BBlNpg XcdWulH57Yl57SApQjlSXm+P/PPjTTcfYXsFDUfS4REpE0rfuNTYmvIR8V4zFUUL3Y7e f8sIsROLBKOxrbSVNs4P+Z7aWXbiqn+lN5OeI= MIME-Version: 1.0 Received: by 10.216.86.212 with SMTP id w62mr562723wee.131.1256559118918; Mon, 26 Oct 2009 05:11:58 -0700 (PDT) In-Reply-To: <26057582.post@talk.nabble.com> References: <26052541.post@talk.nabble.com> <61b5d9410910251549g2073b92dsa9002664510f7402@mail.gmail.com> <26052998.post@talk.nabble.com> <61b5d9410910251852u2055f3a1q424fd8cffe1fbdf@mail.gmail.com> <26057582.post@talk.nabble.com> Date: Mon, 26 Oct 2009 08:11:58 -0400 Message-ID: <61b5d9410910260511h2a66b8e8h6d3e4fd814dbc8aa@mail.gmail.com> Subject: Re: Really Streaming objects to the service client From: Benson Margulies To: users@cxf.apache.org Content-Type: multipart/alternative; boundary=0016e6d9a3a2ec239a0476d577ad --0016e6d9a3a2ec239a0476d577ad Content-Type: text/plain; charset=UTF-8 More specifics? I'd expect: 1) Enable mtom. 2) Declare property of appropriate type. 3) set to your own class that implements DataSource and returning your peculiar input stream. When JAXB or Aegis gets to the property, it will call your stream for the data, and keep calling it and copying the results to the wire, I hope. Now you've got a giant attachment, and how you read it is an entirely other problem. On Mon, Oct 26, 2009 at 6:54 AM, Ronald Pieterse wrote: > > I have done that now but I'm not clear on what the response object should > be. > I've tried using an attachment but then I get in trouble setting the > DataSource. Is there a particular DataSource I should use then? > > > bimargulies wrote: > > > > Well, you could make a rather interesting InputStream that pulled objects > > from your ResultSetExtractor and put that into the DataHandler, so the > > data > > would never be sitting all in one place. > > > > On Sun, Oct 25, 2009 at 7:33 PM, Ronald Pieterse > > wrote: > > > >> > >> I'm all SOAPy and of course you're right about DataSources but in that > >> case > >> the whole source would have to be completely available somewhere, right? > >> I > >> should have the bytes ready either in memory or in a file or something. > >> What I want to do is get thousands of objects from the database using a > >> ResultSetExtractor which allows me to loop through the resultset and > then > >> handle each record separately and send it directly to the client, as I > >> loop > >> through the resultset. > >> The first bit I got working fine - has nothing to do with cxf - but the > >> streaming to the client per object / row is the problem. How would I do > >> that? What would be my response object etc? > >> > >> The client would preferably just use an InputStream or something to get > >> the > >> data, just like with an attachment. > >> > >> Thanx for the quick response. > >> > >> > >> bimargulies wrote: > >> > > >> > Well, let's see. AFAIK, none of the myriad of WS-* things that we have > >> in > >> > CXF directly addresses this, but you many be overly pessimistic about > >> some > >> > aspects. Are you SOAP-y on both ends, or is this a JAX-RS sort of > >> > business? > >> > > >> > CXF doesn't always make temp files out of outgoing attachments. If you > >> > have > >> > a DataHandler / DataSource, it will just pump the bytes. > >> > > >> > HOWEVER, the client side raises harder problems. I'm imagining some > >> sort > >> > of > >> > custom interceptor that would grab the content before MTOM processing > >> has > >> > a > >> > chance to do whatever it normally does, and calls you back. > >> > > >> > This all assumes that you are responsible for data format management; > >> none > >> > of the data bindings that I am familiar with can handle any concept of > >> > incrementally unmarshalling objects and handing them to you. > >> > > >> > People have whole object caching systems for this sort of thing ... > >> > > >> > On Sun, Oct 25, 2009 at 6:35 PM, Ronald Pieterse > >> > wrote: > >> > > >> >> > >> >> Hi, > >> >> > >> >> I have a question about streaming with CXF. I'm already using > >> Attachments > >> >> which works fine but now I need something even more powerful. > >> >> I have a huge amount of objects that i retrieve from the database in > a > >> >> 'streaming' fashion (using Spring's ResultSetExtractor) and now I > want > >> to > >> >> stream them directly to the client, per object if that is at all > >> >> possible. > >> >> I don't want to use an attachment because that would require a temp > >> file > >> >> or > >> >> something like that. And it would also require me to change the > >> signature > >> >> of > >> >> the call. > >> >> > >> >> What are my options here? I'm using CXF 2.1.4 btw. > >> >> THNX > >> >> -- > >> >> View this message in context: > >> >> > >> > http://www.nabble.com/Really-Streaming-objects-to-the-service-client-tp26052541p26052541.html > >> >> Sent from the cxf-user mailing list archive at Nabble.com. > >> >> > >> >> > >> > > >> > > >> > >> -- > >> View this message in context: > >> > http://www.nabble.com/Really-Streaming-objects-to-the-service-client-tp26052541p26052998.html > >> Sent from the cxf-user mailing list archive at Nabble.com. > >> > >> > > > > > > -- > View this message in context: > http://www.nabble.com/Really-Streaming-objects-to-the-service-client-tp26052541p26057582.html > Sent from the cxf-user mailing list archive at Nabble.com. > > --0016e6d9a3a2ec239a0476d577ad--