223.4. 例

from(...).marshal().mimeMultipart()

Content-Type ヘッダーが設定されていないメッセージでは、次のメッセージ Camel ヘッダーを持つメッセージが作成されます。

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);

Camel ヘッダーとして設定された特定の MIME ヘッダーを持たないメッセージ (Content-Type ヘッダーは Camel メッセージから削除されます) と、x- で始まる元のメッセージのすべてのヘッダーと名前 include のヘッダーも含む次のメッセージボディーを作成します:

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