You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2013/10/26 16:07:32 UTC

[jira] [Resolved] (CAMEL-6905) IMAP message flagged as SEEN following rollback

     [ https://issues.apache.org/jira/browse/CAMEL-6905?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-6905.
--------------------------------

    Resolution: Fixed

Thanks for reporting. There is a peek=true option now.

> IMAP message flagged as SEEN following rollback
> -----------------------------------------------
>
>                 Key: CAMEL-6905
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6905
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-mail
>    Affects Versions: 2.12.1
>         Environment: Windows 7
>            Reporter: Dan Ambrose
>            Assignee: Claus Ibsen
>             Fix For: 2.11.3, 2.12.2, 2.13.0
>
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> By default, if you access the content of an IMAPMessage, it will be flagged as SEEN on the server. This creates a problem if the route is subsequently rolled back (due to an exception - e.g. connection error on destination endpoint), the message will remain as SEEN and never get picked up on subsequent polls (unseen=true).
> setPeek(true) should be called on each IMAPMessage before being dispatched to the processor; this ensures that the message will not be automatically flagged as SEEN before being fully consumed.
> As a work around, implement a custom processor that calls setPeek(true) on the original IMAPMessage (using reflection):
> {quote}
> Message msgIn = exchange.getIn();
> Field f = msgIn.getClass().getDeclaredField("originalMailMessage");
> f.setAccessible(true);
> IMAPMessage im = (IMAPMessage) f.get( msgIn );
> im.setPeek(true);
> {quote}
> For reference, this is my route configuration:
> {quote}
> from("imap://sn?username=un&password=xx&delete=false&unseen=true").
> process( new MyCustomAttachmentProcessor() ).
> to("jms://xyz");
> {quote}



--
This message was sent by Atlassian JIRA
(v6.1#6144)