[
https://issues.apache.org/jira/browse/CAMEL-16582?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen updated CAMEL-16582:
--------------------------------
Summary: camel-mail - Error Marshal mimeMultipart() with attachments (was:
Error Marshal mimeMultipart())
> camel-mail - Error Marshal mimeMultipart() with attachments
> -----------------------------------------------------------
>
> Key: CAMEL-16582
> URL: https://issues.apache.org/jira/browse/CAMEL-16582
> Project: Camel
> Issue Type: Bug
> Components: camel-mail
> Affects Versions: 3.7.4
> Environment: Linux Mint 20.1 Ulyssa
> openjdk version "11.0.4" 2019-07-16
> Apache Camel 3.7.4
> Reporter: Ricardo Marques Augusto
> Priority: Major
> Fix For: 3.7.5, 3.10.0
>
> Attachments: stacktrace.txt
>
> Original Estimate: 72h
> Remaining Estimate: 72h
>
> Error when add multiple attachments in AttachmentMessage to marshal as
> mimeMultipart.
>
> Example code:
> {quote}.process(e -> {
> 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()
> {quote}
>
> Checking class MimeMultipartDataFormat I see it is removing attachment during
> iteration:
> {quote}
> for (Map.Entry<String, Attachment> entry :
> exchange.getIn(AttachmentMessage.class).getAttachmentObjects()
> .entrySet()) {
> ...
> exchange.getMessage(AttachmentMessage.class).removeAttachment(attachmentFilename);
> {quote}
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)