You should probably use the ZIP API and send both the object and the PDF in a single file.
Or you could send two messages.
You can't have two bodies on a message.
1 of 1 people found this helpful
If you use message group, you're sure both messages will arrive at the same consumer (case you use two messages)
Clebert, Thanks a lot for your quick response. I tried the zip file approach and it worked fine but we do see some performance issues with large files.
Tried the second approach by grouping messages where I'm sending the file (StreamMessage) as the first mesage and then the java object (ObjectMessage) as the second message both having the same group id. I'm using MDB (poolsize 5) as the consumer but the messages are NOT read sequentially because I see the overlapping print statements from mdb in console.
Also I'd like to know when the messages are grouped, is the order of messages guaranteed? because in my case I want the file to be read always before the object is read. Tried setting the message priorities but still I could not see that happening.
If 2 messages have the same group id then they will be consumed by the same consumer gauranteeing the order, are you saying this is not the case?
if so could you provide a standalone test case to demonstrate the issue.
Andy, yes everything works now, it was a typo, I had used JMSXGROUPID instead of JMSXGroupID. Thanks a lot!
Did you look at the support for large messages?
Depending on the size of your messages.. maybe that would fit well for you... especially the large messaging streaming.
Look at the large message chapter.. it has some cool information.
Clebert, thanks for the info, infact I've implemented the large message streaming already and only when I tried sending an object along with the large file I had issues. Then as you said I tried to zip the object along with the large file but thats where I had performance issues while serializing the object and compressing it.
But now I'm streaming the large file (upto 45mb) and sending the object as a separate message but both grouped together and performance is much better this time. We're using SFTP before for file upload/download and now we are replacing the same with hornetq/ jms.
Thanks to the hornetq team for giving us this wonderful framework and the excellent support you provide.