Results 1 to 3 of 3

Thread: Transfer large files via Hessian

  1. #1
    Join Date
    May 2005
    Posts
    10

    Default Transfer large files via Hessian

    This question has been asked a couple of times before, but there doesn't appear to be a complete answer yet, so I'm going to ask again. Here are the references to the previous questions:

    http://forum.springframework.org/viewtopic.php?t=1179

    http://forum.springframework.org/viewtopic.php?t=1186

    The Hessian code examples included in those two posts appear to be adapted from the code snippet on the Caucho Hessian web site:

    http://www.caucho.com/resin-3.0/prot...ge-binary-data

    The idea being that if you're transfering a large amount of data between client/server in a Hessian call, you're better off handling the data transfer yourself with streams, rather than allowing Hessian to buffer the big file in memory before it handles the transfer for you.

    I am trying to implement this very thing: big file upload/download.

    But, I can't figure out how to use the Spring wrappers around the Hessian classes in order to gain access to the HessianInput and HessianOutput streams I need. Here's the example code snippet from the last URL I listed above:

    OutputStream os = conn.getOutputStream();

    HessianOutput out = new HessianOutput(os);
    out.startCall("download");
    out.writeString("my-file.txt");
    out.completeCall();

    InputStream is = conn.getInputStream();

    HessianInput in = new HessianInput(is);

    in.startReply();

    InputStream is = in.readInputStream();

    ... // save the input stream data somewhere

    in.completeReply();

    Thanks!

    Peter

  2. #2

    Default

    I had to solve this very problem, and I did by brute force, without using spring remoting at all, just mimicking its behaviour. I created a specialized servlet on the server side that can process multiparts using commons-fileupload, and on the client side I've used httpclient to
    invoke the servlet.

    Basically, I'm doing POST requests, every parameter in the remote call is a field in the POST request, and some happen to be InputStreams and OutputStreams handled internally by a multipart POST. The response is a serialized object that contains a result (serialized) and eventually an exception, just like the way Spring remoting is working.

    Hope this helps.

  3. #3
    Join Date
    Nov 2005
    Posts
    2

    Default

    I'm facing the exact same problem now. Has there been any development over the past couple months to ease this burden? Were you forced to interact directly w/ the Hessian API?

    Unfortunately it appears Spring changed their board software, so the links you present are not working any longer, either.

Similar Threads

  1. Saving large files to a db using hibernate?
    By Dan Washusen in forum Data
    Replies: 10
    Last Post: Sep 20th, 2006, 12:18 PM
  2. Managing large Spring XML config files
    By roshang in forum Architecture
    Replies: 7
    Last Post: Oct 12th, 2005, 10:16 AM
  3. Replies: 0
    Last Post: Aug 9th, 2005, 11:49 AM
  4. Hessian with large binary data
    By kotesh in forum Remoting
    Replies: 1
    Last Post: Oct 6th, 2004, 03:46 PM
  5. Protocol Exceptions with Hessian & Burlap
    By dortman in forum Remoting
    Replies: 1
    Last Post: Sep 28th, 2004, 02:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •