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

MailComponent 'peek' doesn't work due to programming error

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.12.2
    • Fix Version/s: 2.11.5, 2.12.4, 2.13.0
    • Component/s: camel-mail
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      The MailComponent peek setting doesn't work due to the following line:

          private void peekMessage(Message mail) {
              // this only applies to IMAP messages which has a setPeek method
              if (mail.getClass().getName().startsWith("IMAP")) {
                  try {
                      LOG.trace("Calling setPeek(true) on mail message {}", mail);
                      IntrospectionSupport.setProperty(mail, "peek", true);
                  } catch (Throwable e) {
                      // ignore
                      LOG.trace("Error setting peak property to true on: " + mail + ". This exception is ignored.", e);
                  }
              }
          }
      

      The line that checks the class name for IMAP should be using getSimpleName. Otherwise it's checking the package name instead.

      This effectively means that rollback of processing in camel mail is not supported.

        Attachments

          Activity

            People

            • Assignee:
              njiang Willem Jiang
              Reporter:
              mattnathan Matt Nathan
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: