gnodet commented on PR #31170:
URL: https://github.com/apache/camel/pull/31170#issuecomment-7311296369

   Thanks for the thorough review, @oscerd!
   
   The `skipFailedMessage=true` / permanently-corrupt-attachment case is indeed 
a conscious trade-off. The original behaviour was arguably wrong in a more 
fundamental sense: the idempotent repository is meant to track *successfully 
consumed* mails, not *failed ones*. Permanently suppressing a mail because 
`createExchange` threw an exception means a transient failure (a network hiccup 
on the attachment fetch, a brief codec error) silently poisons the key forever 
— the mail is never retried even after the root cause is fixed.
   
   The revised behaviour is: a mail that fails to become an exchange is **not** 
considered consumed. That means:
   - **Transient failures** now recover correctly on the next poll (the main 
motivation for the fix).
   - **Permanently corrupt attachments** with `skipFailedMessage=true` are 
indeed retried every poll. If a user wants permanent suppression of a poison 
mail they can either: (a) delete it from the mailbox, (b) pre-seed the 
idempotent repository with its key, or (c) use a dead-letter strategy at the 
route level.
   
   This is a deliberate trade-off in favour of correctness over convenience. I 
will add a note to the docs/comments if that would help clarify the semantics.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to