Jussi Nupponen created CAMEL-9106:
-------------------------------------
Summary: URI option mapMailMessage doesn't obey peek=true option
Key: CAMEL-9106
URL: https://issues.apache.org/jira/browse/CAMEL-9106
Project: Camel
Issue Type: Bug
Components: camel-mail
Affects Versions: 2.15.3
Reporter: Jussi Nupponen
URI option mapMailMessage=true as is the default with Mail Component fetches
IMAP-messages without peek=true option. This results to faulty rollback logic
since in case of an exception and rollback, messages are already marked with
flag SEEN and won't be rolled back to UNSEEN.
Messages are marked with peek-option in processBatch-method but mapping mail
messages to Camel messages happens before that method call in
createExchanges-method.
I've attached a patch where peek option is set to the messages already in the
poll-method which resolves the issue. Unfortunately I couldn't write a proper
jUnit test for this scenario since org.jvnet.mock_javamail.Mailbox doesn't seem
to support marking messages as SEEN even if they have been fetched. However, I
have attached traces of faulty and fixed run with a test route (that route is
also included).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)