First: I'm glad you are using the Stream large messages feature. very nice!
The ReadOnly message is because of the JMS Spec and TCK tests... we were bound to throw an exception if the message was read-only.. that is valid for any JMS Message.. not only large messages. Second you could resend a large message, but there is one caveat: Large Messages will need to be assembled in the client. The following gist shows a little modification I made on the large message example (against master since I have done major updates to all examples): https://gist.github.com/clebertsuconic/d086a80980fea225534f The example will pass if I use a small size (such as 2 MB) but it will fail with an OME if you set it very large. So, I would recommend you receive the message and creating a new message before you send it, copying all the properties and a new data with the stream you used. On Sat, Aug 8, 2015 at 6:08 AM, Petter Nordlander <[email protected]> wrote: > Hi, > > How do I best copy a large message using JMS API? > > > I have a JMS listener that just wants to check the message and pass it along > to another queue. > > Simply sending the same incoming message is not possible (read only > exception). > > > So I figured I need to copy the entire message content (might be GBs of data) > to the new message copy. However, how is that possible without saving the > data to a local temp file? > > msg.setObjectProperty("JMS_HQ_SaveStream", output); > > and > > messageToTransfer.setObjectProperty("JMS_AMQ_InputStream”, input); > > both blocks, so I don’t really know if it’s possible to stream from one large > message to a new ”copy”. > > How would you guys do such a thing without reading the entire file to a > temporary space in the application? > > Best regards > Petter Nordlander -- Clebert Suconic
