activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject support for FileMessage?
Date Thu, 16 Nov 2006 09:01:50 GMT
Saw an interesting blog post today...

As I mentioned on the comments, I'd like to extend this a little to
support both out-of-band transfer (e.g. its basically a message with a
URL in it to that the user can download the file from some remote
destination) or the file is actually sent over the JMS network, so it
can act as a facade to the existing JMS Streams feature...

So am thinking from a client API perspective they do one of the following...

// send a message out of band...
FileMessage message = session.createRemoteFileMessage(new

// send a local file over the JMS network
FileMessage message = session.createLocalFileMessage(new

then for consumers...

if (message instanceof FileMessage) {
  FileMessage fileMessage = (FileMessage) message;
  InputStream in = fileMessage.getInputStream();
  // lets read the file...

  // or lets force the file to be manifested as a local file so we can
work directly on the file instead

  URL url = fileMessage.getURL();
  // we can now open the file as many times as we like...




View raw message