users@glassfish.java.net

Re: JavaMail and streaming

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 17 Mar 2009 17:19:54 +0100

On Mar 17, 2009, at 5:13 PM, Peter Williams wrote:

> Hi Paul,
>
> There isn't currently anyway for JavaMail's multipart support to do
> what you ask. It isn't designed to support arbitrarily large streams.
>
> The Metro support you mention is seems much more suited for the task
> (large uploads/downloads) you are supporting.
>

Thanks, I have just switched over to using MIMEPull and am in the
process of testing.

Paul.

> -Peter
>
> Paul Sandoz wrote:
>> Hi,
>>
>> Jersey utilizes JavaMail for parsing "multipart/*" messages, but we
>> are encountering out of memory issues for large body parts [1].
>>
>> Are there conditions under which JavaMail will not buffer if body
>> parts, e.g. if the parts are accessed in serialization order. I
>> want to understand what is possible before deciding to switch to
>> something else.
>>
>> It may be we need to switch to a streaming based parser. Two APIs
>> come to mind:
>>
>> 1) MIME pull, which is used by Metro
>> https://mimepull.dev.java.net/
>>
>> 2) Mime4j
>> http://james.apache.org/mime4j/
>>
>> Paul.
>>
>> [1] https://jersey.dev.java.net/issues/show_bug.cgi?id=238
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>