Data Formats are features that allow you to transform messages between different formats during the integration flow. They work as message translators, automatically converting data from one format to another.
Imagine you need to integrate two systems: one sends data in JSON and the other only accepts CSV. Data Formats solve this problem by automatically converting during the integration flow.
There are two main operations or EIPs that work with data formats:
Unmarshal: Converts data in an external format (such as JSON, XML, or CSV received over the network) to Camel's internal structure, allowing it to be processed and manipulated in the integration flow.
Marshal: Converts Camel's internal structure back to an external format (binary or textual), preparing the data to be sent over the network or saved to a file.
Think of Unmarshal as "reading and interpreting" data that arrives in a specific format, and Marshal as "packaging and formatting" data to be sent or stored.
When configuring the Unmarshal/Marshal EIPs, you must select which data format you want to use in the Data Format Type field.
The most commonly used data formats are:
JSON: ideal for REST APIs and communication between modern systems. It is lightweight, readable, and widely supported by different programming languages.
CSV: used for exporting reports, integrating with spreadsheets, and batch processing of tabular data.
Custom: allows you to convert Excel spreadsheets into an array of JSON objects and vice versa.
Check out the data formats available in Integrations. Click each data format to see details and examples.
Format | Description |
|---|---|
| asn1 | ASN.1 encoding (Abstract Syntax Notation), used in telecommunications and cryptography |
| avro | Apache Avro serialization format for big data and streaming |
| barcode | Barcode generation and reading |
| base64 | Base64 encoding/decoding for binary data |
| crypto | Data encryption and decryption |
| csv | Comma-separated values files |
| custom | Custom formats (Excel) |
| flatpack | Structured text file processing |
| gzipDeflater | GZIP compression and decompression |
| jacksonXml | Conversion between XML and objects using Jackson |
| jaxb | Binding between XML and Java objects (Java Architecture for XML Binding) |
| json | JavaScript Object Notation, lightweight data exchange format |
| jsonApi | JSON API format (jsonapi.org specification) |
| lzf | High-speed LZF compression |
| mimeMultipart | MIME multipart messages (emails, uploads) |
| pgp | PGP encryption (Pretty Good Privacy) |
| protobuf | Google's Protocol Buffers for efficient serialization |
| soap | SOAP messages for web services |
| syslog | System log format (RFC 3164 and RFC 5424) |
| tarFile | TAR files (Tape Archive) |
| univocityCsv | High-performance CSV parser from Univocity |
| univocityFixed | Parser for fixed-width files from Univocity |
| univocityTsv | TSV parser (tab-separated values) from Univocity |
| xmlSecurity | XML signature and encryption |
| zipDeflater | ZIP compression and decompression |
| zipFile | ZIP file handling |
NOTEFor more information, see the official Apache Camel Data Formats documentation.
We use cookies to enhance your experience on our site. By continuing to browse, you agree to our use of cookies.Learn more