Interface IMessageDataFormat
A data format that works on the whole exchange rather than on bytes alone, as Apache Camel's DataFormat
receives the exchange: it reads the content type of the In message with its parameters (a boundary, a
charset), reads the body as it came (byte[], string or a , without buffering
by the step), writes the body, the content type and the attachments, and takes engine settings from
(the stream cache a large part spools to). Marshal, Unmarshal and
ConvertBody call these methods when the resolved format implements this interface, and the byte methods of
otherwise.
public interface IMessageDataFormat : IMessageSerializer
Methods
MarshalAsync(IExchange, CancellationToken)
Turns the body of exchange.In (and its attachments, when the format carries them) into the wire form, in place.
ValueTask MarshalAsync(IExchange exchange, CancellationToken ct = default)
UnmarshalAsync(IExchange, Type, CancellationToken)
Turns the wire form in exchange.In into targetType, in place.
ValueTask UnmarshalAsync(IExchange exchange, Type targetType, CancellationToken ct = default)
Remarks
Registration, lookup by content type and the XML dataFormat element are those of
. A format sets and the Content-Type header
itself; the step does not overwrite them. A format decides itself what to do with a body that is not its own (MIME
multipart leaves it unchanged, as Camel's mimeMultipart does).