blob: f1e897bc0f672589c87ec610f7a98fefcfdcdece [file] [log] [blame]
= Data Format Component
:doctitle: Data Format
:shortname: dataformat
:artifactid: camel-dataformat
:description: Use a Camel Data Format as a regular Camel Component.
:since: 2.12
:supportlevel: Stable
:tabs-sync-option:
:component-header: Only producer is supported
:core:
//Manually maintained attributes
:camel-spring-boot-name: dataformat
*Since Camel {since}*
*{component-header}*
The Data Format component allows using xref:manual::data-format.adoc[Data Format] as a Camel Component.
== URI format
----
dataformat:name:(marshal|unmarshal)[?options]
----
Where *name* is the name of the Data Format.
And then followed by the operation which must either be `marshal` or `unmarshal`.
The options are used for configuring the xref:manual::data-format.adoc[Data Format] in use.
See the Data Format documentation for which options it supports.
== DataFormat Options
// component options: START
include::partial$component-configure-options.adoc[]
include::partial$component-endpoint-options.adoc[]
include::partial$component-endpoint-headers.adoc[]
// component options: END
== Examples
For example, to use the xref:dataformats:jaxb-dataformat.adoc[JAXB] xref:manual::data-format.adoc[Data Format], we can do as follows:
[tabs]
====
Java::
+
[source,java]
----
from("activemq:My.Queue").
to("dataformat:jaxb:unmarshal?contextPath=com.acme.model").
to("mqseries:Another.Queue");
----
XML::
+
[source,xml]
----
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="activemq:My.Queue"/>
<to uri="dataformat:jaxb:unmarshal?contextPath=com.acme.model"/>
<to uri="mqseries:Another.Queue"/>
</route>
</camelContext>
----
====
include::spring-boot:partial$starter.adoc[]