Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-7247

No way to 'abort' the onCompletion action of the MailConsumer


    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.12.2
    • Fix Version/s: 2.17.0
    • Component/s: camel-mail
    • Labels:
    • Estimated Complexity:


      I have a route that reads from an email inbox, passes the message through a distributed IdempotentConsumer and then processes the mail if it's not been seen before.

      The reason I have this setup is because we are running multiple instances of camel all pointing to the same inbox and don't want mails to be processed more than once across the cluster.

      Now leaving aside the fact that this may not be the best way to achieve what we want to do, the issue I have is that when the route completes, either by 'aborting' as part of the IdempotentConsumer filtering or by processing the mail successfully, the completion listener added by the MailComponent always gets called.

      This is not ideal because it effectively disables any rollback or reprocessing logic that may exist, and was even more problematic for us as we had delete=true set on the MailConsumer, which meant mails were removed under the feet of the node that was actually processing the mail.

      What I'd like is a way for the route to complete successfully but for the MailComponent to not do anything to the mail. A state which is currently impossible without overriding the mail component (it either marks as deleted or marks as read, there is no 'don't do anything' option)




            • Assignee:
              davsclaus Claus Ibsen
              mattnathan Matt Nathan
            • Votes:
              0 Vote for this issue
              3 Start watching this issue


              • Created: