activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: Consuming a group of messages in a single transaction
Date Fri, 28 Jul 2006 08:52:33 GMT
Great idea :)

On 7/28/06, Hiram Chirino <hiram@hiramchirino.com> wrote:
> 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 <james.strachan@gmail.com> wrote:
> >
> > On 7/28/06, Hiram Chirino <hiram@hiramchirino.com> 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
>
>


-- 

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

Mime
View raw message