[ https://issues.apache.org/jira/browse/CAMEL-24403 ]


    mayur mohan deleted comment on CAMEL-24403:
    -------------------------------------

was (Author: JIRAUSER314144):
h2. Pull Request

A fix has been submitted as a GitHub Pull Request against the Apache Camel main 
branch:

*PR:* https://github.com/apache/camel/pull/25550
*Title:* CAMEL-24403: camel-mail: handle MessageRemovedException in 
processCommit to avoid null cause in error log
*Branch:* fix/mail-consumer-message-removed-exception-null-cause
*Author:* mayurbm (AI-assisted via Claude Code)

h3. Files Changed

* 
{{components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java}}
** Added {{jakarta.mail.MessageRemovedException}} import
** Added dedicated catch block for {{MessageRemovedException}} *before* the 
generic {{MessagingException}} handler in {{processCommit()}}
** Wraps the exception with an explicit non-null description message

* 
{{components/camel-mail/src/test/java/org/apache/camel/component/mail/MailConsumerCommitExpungedMessageTest.java}}
 _(new file)_
** Test 1: {{testCommitWithExpungedMessageProducesNonNullCause}} - verifies 
{{MessageRemovedException}} is wrapped in a {{MessagingException}} with a 
non-null message
** Test 2: {{testCommitWithOtherMessagingExceptionPassedThroughAsIs}} - 
verifies other {{MessagingException}} types are passed through unchanged

h3. Test Results

{noformat}
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
{noformat}

h3. Expected Log Output After Fix

{noformat}
Error occurred during committing mail message: 
com.sun.mail.imap.IMAPMessage@542a494d. Exchange[...]. Caused by: 
[javax.mail.MessagingException - Message already removed/expunged on server (no 
flag update possible)]
{noformat}

> camel-mail: MessageRemovedException in processCommit causes null in error log
> -----------------------------------------------------------------------------
>
>                 Key: CAMEL-24403
>                 URL: https://issues.apache.org/jira/browse/CAMEL-24403
>             Project: Camel
>          Issue Type: Bug
>            Reporter: mayur mohan
>            Priority: Major
>
> test update



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to