Hi all.
We're using mime4j to read/parse messages and storing them in a database. For
large messages we get OutOfMemoryErrors because BasicBodyFactory and
BasicBinaryBody operate on byte[].
I see on this page: https://james.apache.org/mime4j/
that the Message-class is referenced which according to the JavaDoc operate on
streams which looks like it would fit perfect for us. The problem is that I
cannot find this class anywhere.
We're using the following code to parse an input-stream:
val messageBuilder = new DefaultMessageBuilder() val mimeConfig = new
MimeConfig() mimeConfig.setMaxContentLen(-1) // disable
mimeConfig.setMaxLineLen(-1) // disable mimeConfig.setMaxHeaderCount(-1) //
disablemimeConfig.setMaxHeaderLen(-1) // disable
messageBuilder.setMimeEntityConfig(mimeConfig)val mimeMessage: Message =
messageBuilder.parseMessage(is)
Can anyone please point me to the correct dependencies to be able to use the
Message-class instead, and hopefully some code-example of how to use it to
accomplish the same as the code above except with hopefully a lot less
memory-usage?
Thanks.
-- Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
[email protected] <mailto:[email protected]>
www.visena.com <https://www.visena.com>
<https://www.visena.com>