[prev in list] [next in list] [prev in thread] [next in thread] 

List:       james-user
Subject:    Re: Sending emails to JMS (Java Messaging Service)
From:       "Ataul Wadood Ahmad" <mail () ahmadsoft ! de>
Date:       2007-03-28 7:39:45
Message-ID: 38027.217.5.231.249.1175067585.squirrel () www ! ahmadsoft ! de
[Download RAW message or body]

Hi Stefano,

thank you for your hint. By the way MimeMessage is either not serialized.

I used the workaround to send to a JMS Que (as you proposed):

ByteArrayOutputStream os = new ByteArrayOutputStream();
mimeMessage.writeTo(os);
String content = os.toString();
ObjectMessage mesg = jmsSession.createObjectMessage(content);
jmsSender.send(mesg);

And to read from a JMS Que:

String content = (String)jmsMsg.getObject();
byte[] bytes = content.getBytes();
ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
MimeMessage emailMessage = new MimeMessage(null, bis);

This helps. Thanks.
Ataul

> Well, mimemessages are intended to be serialized. In fact in pop3 and
> smtp service we do that all of the time. Hint:
> MimeMessage.writeTo(OutputStream out) and MimeMessage(InputStream source).
>
> Stefano
>
> Ataul Wadood Ahmad ha scritto:
>> Hello,
>>
>> has somebody experience in sending emails from JAMES to JMS.
>> The problem is that JavaMail API is in general not serialized and can't
>> be
>> send to a Messaging Service as an Object. Since I want to establish
>> asynchronous communication streaming is no option.
>>
>> I appreciate any help. Thanks.
>>
>> Ataul
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>
>


-- 
Ataul W. Ahmad
-Certified Project Management Associate (GPM, IPMA)-
-Sun Certified Java Developer-

email: mail@ahmadsoft.de
Fon: +49 177 829 87 39
Fax: +49 571 398 13 77



---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic