I'm thinking that it's use would look something like this on the producer
side:

message = new ActiveMQInputStreamMessage();
message.setInputStreamFactory( new InputStreamFactory() {
  InputStream createInputStream() throws IOException {
      return new FileInputStream("/path/to/big/file/you/want/to/send");
  }
});
producer.send(message);

and on the consumer side it would be like:

message = (ActiveMQInputStreamMessage)consumer.receive();
InputStream is = message.openInputStream();
// use the InputStream to read the data.
is.read();

What do you think? The cool thing is that this would even work over topics
since the producer would just read the file multiple times.

On 7/28/06, James Strachan <[EMAIL PROTECTED]> wrote:

On 7/28/06, Hiram Chirino <[EMAIL PROTECTED]> wrote:
> At one point we were considering implementing an InputStreamMessage
which
> allowed a producer ship a consumer an 'InputStream'.  Basically the
consumer
> would only be able to read the input stream while the the producer is
still
> online.  The upside to this is that you get the benefits of sending the
big
> data out of band but still just using JMS network.

Yeah. We could maybe do transactions between the producer and consumer
directly so if the consumer fails the transfer starts again from the
beginning etc.

--

James
-------
http://radio.weblogs.com/0112098/




--
Regards,
Hiram

Blog: http://hiramchirino.com

Reply via email to