Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
3.7.4
-
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);