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

camel-mail - Error Marshal mimeMultipart() with attachments

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.7.4
    • 3.7.5, 3.10.0
    • camel-mail
    • None
    • Linux Mint 20.1 Ulyssa
      openjdk version "11.0.4" 2019-07-16
      Apache Camel 3.7.4

    • Novice

    Description

      Error when add multiple attachments in AttachmentMessage to marshal as mimeMultipart.

       

      Example code:

      .process(e ->

      Unknown macro: { AttachmentMessage am = e.getMessage(AttachmentMessage.class); am.addAttachment("front-image-file", new DataHandler(new FileDataSource(...))); am.addAttachment("back-image-file", new DataHandler(new FileDataSource(...))); }

      )
      .marshal()
      .mimeMultipart()

       

      Checking class MimeMultipartDataFormat I see it is removing attachment during iteration:

      for (Map.Entry<String, Attachment> entry : exchange.getIn(AttachmentMessage.class).getAttachmentObjects()
      .entrySet()) {
      ...
      exchange.getMessage(AttachmentMessage.class).removeAttachment(attachmentFilename);

       

      Attachments

        1. stacktrace.txt
          2 kB
          Ricardo Marques Augusto

        Activity

          People

            Unassigned Unassigned
            rmaugusto Ricardo Marques Augusto
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 72h
                72h
                Remaining:
                Remaining Estimate - 72h
                72h
                Logged:
                Time Spent - Not Specified
                Not Specified