I would save the Message locally before you forward it anywhere else.

On Fri, Aug 5, 2022 at 7:35 AM Jan Šmucr <jan.sm...@aimtecglobal.com> wrote:
>
> Hi Domenico,
> thank you for your response.
> Unfortunately, this does not work either.
>
> Tests which use this method pass fine, because the output stream happens to 
> be a FileOutputStream instance which does not block (unless there’s some 
> issue with the underlying file system).
>
> Jan
>
> From: Domenico Francesco Bruscino<mailto:bruscin...@gmail.com>
> Sent: pátek 5. srpna 2022 12:57
> To: dev@activemq.apache.org<mailto:dev@activemq.apache.org>
> Subject: Re: A question about ClientMessage.setOutputStream()
>
> Hi Jan,
>
> calling checkCompletion() or getBodyBuffer() before
> calling setOutputStream(OutputStream) should fix your issue.
>
> Regards,
> Domenico
>
> On Fri, 5 Aug 2022 at 11:06, Jan Šmucr <jan.sm...@aimtecglobal.com> wrote:
>
> > Hello.
> >
> > The Large Messages documentation states that:
> > > setOutputStream(OutputStream): Set the OutputStream that will receive
> > the body of a message. This method does not block.
> >
> > However if I write something like this:
> >
> > InputStream input = new PipedInputStream(1);
> > OutputStream output = new PipedOutputStream(input);
> > msg.setOutputStream(output);
> > // Now imagine I read something from the input and then:
> > msg.waitOutputStreamCompletion(0);
> >
> > …then never make it beyond the msg.setOutputStream(output) line.
> >
> > Is there something I don’t understand about the method being non blocking
> > as opposed to the saveToOutputStream method?
> >
> > Thank you.
> > Jan
> >
>


-- 
Clebert Suconic

Reply via email to