General J2EE: Best practice passing streamy data between tiers?

  1. Best practice passing streamy data between tiers? (1 messages)

    We have an application that stores multi megabyte data files sent, and occasionally requested, by the client. When running the webapp in the same jvm we can get away with passing InputStreams around but what are the best practices to support sending such data between webapp and app server running on separate boxes? The obvious solution is to read the streams into memory and pass byte arrays through the ejb calls but this is a little nasty when the occasional 100+Mb file is being sent. Surely there is a more elegant streamy solution?


  2. Can you not cache them on the filesystem and expose them via a URL?

    If they do have to come out of the database, you don't really have much choice.