[[DataFormatComponent-DataFormatComponent]]
Data Format Component
~~~~~~~~~~~~~~~~~~~~~

*Available as of Camel 2.12*

The *dataformat:* component allows to use link:data-format.html[Data
Format] as a Camel link:component.html[Component].

[[DataFormatComponent-URIformat]]
URI format
^^^^^^^^^^

[source,java]
---------------------------------------------
dataformat:name:(marshal|unmarshal)[?options]
---------------------------------------------

Where *name* is the name of the link:data-format.html[Data Format]. And
then followed by the operation which must either be `marshal` or
`unmarshal`. The options is used for configuring the link:data-format.html[Data
Format] in use. See the link:data-format.html[Data Format] documentation
for which options it support.

[[DataFormatComponent-Options]]
DataFormat Options
^^^^^^^^^^^^^^^^^^


// component options: START
The Data Format component has no options.
// component options: END



// endpoint options: START
The Data Format component supports 3 endpoint options which are listed below:

{% raw %}
[width="100%",cols="2,1,1m,1m,5",options="header"]
|=======================================================================
| Name | Group | Default | Java Type | Description
| name | producer |  | String | *Required* Name of data format
| operation | producer |  | String | *Required* Operation to use either marshal or unmarshal
| synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
|=======================================================================
{% endraw %}
// endpoint options: END


[[DataFormatComponent-Samples]]
Samples
^^^^^^^

For example to use the link:jaxb.html[JAXB] link:data-format.html[Data
Format] we can do as follows:

[source,java]
-------------------------------------------------------------
from("activemq:My.Queue").
  to("dataformat:jaxb:unmarshal?contextPath=com.acme.model").
  to("mqseries:Another.Queue");
-------------------------------------------------------------

And in XML DSL you do:

[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>
-----------------------------------------------------------------------

[[DataFormatComponent-SeeAlso]]
See Also
^^^^^^^^

* link:configuring-camel.html[Configuring Camel]
* link:component.html[Component]
* link:endpoint.html[Endpoint]
* link:getting-started.html[Getting Started]
* link:data-format.html[Data Format]

