shashank created CAMEL-25733:
--------------------------------

             Summary: camel-mail - remove the idempotent key of the mail whose 
processExchange throws, not only of the rest of the batch
                 Key: CAMEL-25733
                 URL: https://issues.apache.org/jira/browse/CAMEL-25733
             Project: Camel
          Issue Type: Improvement
          Components: camel-mail
            Reporter: shashank
            Assignee: shashank


Follow-up of CAMEL-25710 (raised in the review of 
https://github.com/apache/camel/pull/27990).

With an {{idempotentRepository}}, CAMEL-25710 gives back the mails of a batch 
that are not routed, also when routing an exchange throws. The exchange that 
{{processExchange}} itself throws on is already taken from the queue, so its 
key stays in the repository and that mail is skipped as a duplicate until the 
key is removed. Only an unchecked exception escaping {{processExchange}} 
reaches this path (routing errors normally land on the exchange).

Proposed change: in {{processBatch}}, catch the exception of 
{{processExchange}}, remove the key of that mail (when the exchange did not 
complete), and rethrow; with a test in 
{{MailIdempotentRepositoryPollErrorTest}}.

_Filed with Claude Code on behalf of allthingssecurity._




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

Reply via email to