hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Barnes <barne...@gmail.com>
Subject Need a way to send a URL's stream as multi-part entity with repeatable blocks
Date Wed, 17 Dec 2014 23:37:53 GMT
Hello community!

My team is faced with a problem where we need to send a resource that is
available via URL (more precisely, it is on our classpath).  We are running
in a servlet container, so we don't have direct access to the file system.
I completely understand why the chunks are marked as "Non-repeatable" when
using an InputStream, because in general they are not necessarily
repeatable.

Currently we are reading the URL in its entirety to memory, then shipping
it off.  This is quite burdensome because of the size of the resources and
number of concurrent users we can expect.  The best we can do is create a
singleton of the value in memory, but it still is expensive for something
which could certainly be streamed.

Are there any approaches we can utilize to send a URL's contents to a
multi-part while being repeatable without reading it entirely into memory?

Thanks!
Joe

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message