Search code examples
apache-camel

What is the meaning of "attachments" in message model?


I read the book "Camel in Action". But I can't understand what "attachment" means in its message model.

I know what are headers such like "sender information", "receiver information", or "data encoding" etc. However, I don't know what is meant by "attachments"?


Solution

  • Lets run through some examples

    • You are consuming a file, camel can create a message with contents of the file as payload and file name etc as message headers
    • You are consuming a jms message, camel can create a message with contents of jms message as payload and jms header etc as message headers.
    • You are sending simple http request, camel can crate a message with what is inside the http request as paylaod and url etc as headers

    Then you have some other components

    • You can send an email with some text in the body and some attachments, so in this case camel creates a message with payload, headers and attachments
    • You can also send SOAP request with attachments, in this case also, camel creates the message with payload, headers and attachments.

    But there is not many camel components which support attachment. There is few like email, soap service etc