camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1459317 - /camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java
Date Thu, 21 Mar 2013 13:59:50 GMT
Author: davsclaus
Date: Thu Mar 21 13:59:50 2013
New Revision: 1459317

URL: http://svn.apache.org/r1459317
Log:
CAMEL-6193: Mail consumer when mapMailMessage=true we should eager map message to ensure all
mail data is read, so when the folder is closed later, we wont be in trouble.

Modified:
    camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java

Modified: camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java?rev=1459317&r1=1459316&r2=1459317&view=diff
==============================================================================
--- camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java
(original)
+++ camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java
Thu Mar 21 13:59:50 2013
@@ -216,6 +216,13 @@ public class MailConsumer extends Schedu
             Message message = messages[i];
             if (!message.getFlags().contains(Flags.Flag.DELETED)) {
                 Exchange exchange = getEndpoint().createExchange(message);
+                if (getEndpoint().getConfiguration().isMapMailMessage()) {
+                    // ensure the mail message is mapped, which can be ensured by touching
the body/header/attachment
+                    LOG.trace("Mapping #{} from javax.mail.Message to Camel MailMessage",
i);
+                    exchange.getIn().getBody();
+                    exchange.getIn().getHeaders();
+                    exchange.getIn().getAttachments();
+                }
 
                 // If the protocol is POP3 we need to remember the uid on the exchange
                 // so we can find the mail message again later to be able to delete it



Mime
View raw message