springfile-iostreamingspring-remotinghttpinvoker

Streaming with Spring Framework


I have developed a client (Eclipse) server (Spring Framework on Tomcat) application using Spring Remoting over HttpInvoker.

Some usecases need to transfer large files (>150MB) from server to client. Since we're on a 32Bit system on client side, I always get a Java heap size problem (althoough I set the Xmx to 1014 MB - but files could even be bigger).

My question is: Is there any way to do streaming over HttpInvoker or something else to solve this problem?


Solution

  • see rmiio : RMIIO

    RMIIO is a library which makes it as simple as possible to stream large amounts of data using the RMI framework (or any RPC framework for that matter). Who needs this? Well, if you have ever needed to send a file from an RMI client to an RMI server, you have faced this problem. And, if you did manage to implement a basic solution, it probably threw an OutOfMemoryError the first time someone tried to send a 2GB file. Due to the design of RMI, this common and deceptively simple problem is actually quite difficult to solve in an efficient and robust manner.

    you can use it standalone or over any other rmi framework such as httpInvoker.