Saving a JMS Message in a Persistent Store

Hello Friends,

I am going to store a JMS message in a persistent store like a database and then recreate it when needed. What I will be doing is storing the JMS headers individually. Then storing all the properties and then the message body. I just wanted to confirm that with this data I would be able to recreate the entire message.

[347 byte] By [salilsurendrana] at [2007-10-2 21:04:37]
# 1

Not sure of the answer to this (I suspect re-creating the message with exactly the same values as it started with will be a bit more tricky than you would imaging). Why don't you try creating a blank message and setting every single header / property? You'll probably get some exceptions / values being over written when you send.

The real question is are you 100% sure you need to do this? The whole idea smells fishy. Why do you need the JMS Headers? Things would be far easier if the body of the message contained everything you needed. Why do you have to store the message in a database rather than leave it on a persistent queue?

SteveNaivea at 2007-7-13 23:49:49 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
The reason that I need to store a message in a database is because I am trying to implement a functionality where I need to replay a message on request. so what I am doing is storing all teh JMS headers and properties along with the body of a message.
salilsurendrana at 2007-7-13 23:49:49 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...