Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Data Formats

A data format converts a message body between a wire representation and a structured type. Each format implements the DataFormat trait from camel-api. The trait defines a marshal operation (body to wire) and an unmarshal operation (wire to body). Per ADR-0030, the trait also exposes Exchange-aware hooks for formats that read or write Exchange metadata.

The Marshal and Unmarshal EIP page covers route-level usage.

Available formats

FormatCrateBody mapping
jsonbuilt-in (camel-processor)Text ↔ Json
csvbuilt-in (camel-processor)Text ↔ Json
xmlbuilt-in (camel-processor)Text ↔ Json
protobufcamel-dataformat-protobufJson ↔ Bytes

JSON, CSV, and XML are registered by default. Protobuf ships as a separate crate.

Reference: DataFormat trait