Serializing MimeMessage

Hi all,

I have a requirement wherein I need to enqueue a MimeMessage into a JMS queue. Now MimeMessage is not serializable! And I wonder why!

Now here is the problem. I want to invoke the message.getContent() method only after I dequeue from the queue. Which means I will need the entire MimeMessage to be enqueued along with the Session and Folder information. Does the .writeTo(OutputStream) method write this information also into the stream? If no, then what is the alternative?

Again how do I serialize the MimeMessage without losing any info - Folder and Session?

Thanks,

Prabhu

PS - For serialization experts who stumble upon this - The getContent() method actually goes back to the mail server, so we need to retain Session information in this case.

[800 byte] By [prabhu.ramadasa] at [2007-11-27 10:49:30]
# 1

I'm sure you found the FAQ entry that addresses this, right?

You can't serialize an open Folder because it contains an open

TCP connection that clearly can't move from machine to machine.

What Folder and Session information do you need in the code

that operates on the deserialized message?

bshannona at 2007-7-29 11:19:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

Shannon,

Many thanks for the reply!

I am going to be using the MimeMessage.getContent() method only on the deserialized message object. Now this does require the Folder and Session information right?

Or do you have a workaround?

Thanks,

Prabhu

prabhu.ramadasa at 2007-7-29 11:19:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3

If you use the writeTo method to transfer the content of the message,

you don't need the Folder and Session objects. All of the message

content will be available.

bshannona at 2007-7-29 11:19:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4

Thannks Shannon!

prabhu.ramadasa at 2007-7-29 11:19:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...