212.4. 例
from(...).marshal().mimeMultipart()
Content-Type ヘッダーが設定されていないメッセージでは、以下のメッセージ Camel ヘッダーで Message を作成します。
Camel メッセージヘッダー
Content-Type=multipart/mixed; \n boundary="----=_Part_0_14180567.1447658227051"
Message-Id=<...>
MIME-Version=1.0
The message body will be:
Camel メッセージボディー
------=_Part_0_14180567.1447658227051
Content-Type: application/octet-stream
Content-Transfer-Encoding: base64
Qm9keSB0ZXh0
------=_Part_0_14180567.1447658227051
Content-Type: application/binary
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="Attachment File Name"
AAECAwQFBgc=
------=_Part_0_14180567.1447658227051--
ヘッダー Content-Type がルートに送信される "text/plain" に設定されたメッセージ
from("...").marshal().mimeMultipart("related", true, true, "(included|x-.*)", true);
特定の MIME ヘッダーを Camel ヘッダーとして設定せずにメッセージを作成します(Content-Type ヘッダーが Camel メッセージから削除されます)と、"x-" で始まる元のメッセージのヘッダーがすべて含まれ、名前に "included" のヘッダーも含まれる以下のメッセージボディーが作成されます。
Camel メッセージボディー
Message-ID: <...>
MIME-Version: 1.0
Content-Type: multipart/related;
boundary="----=_Part_0_1134128170.1447659361365"
x-bar: also there
included: must be included
x-foo: any value
------=_Part_0_1134128170.1447659361365
Content-Type: text/plain
Content-Transfer-Encoding: 8bit
Body text
------=_Part_0_1134128170.1447659361365
Content-Type: application/binary
Content-Transfer-Encoding: binary
Content-Disposition: attachment; filename="Attachment File Name"
[binary content]
------=_Part_0_1134128170.1447659361365