Announcement Announcement Module
No announcement yet.
Transfer large files via Hessian Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

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

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

    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);

    InputStream is = conn.getInputStream();

    HessianInput in = new HessianInput(is);


    InputStream is = in.readInputStream();

    ... // save the input stream data somewhere




  • #2
    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
      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.