camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (Confluence)" <conflue...@apache.org>
Subject [CONF] Apache Camel > DataFormat Component
Date Mon, 12 Aug 2013 18:37:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/en/2176/1/1/_/styles/combined.css?spaceKey=CAMEL&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/CAMEL/DataFormat+Component">DataFormat
Component</a></h2>
    <h4>Page  <b>added</b> by             <a href="https://cwiki.apache.org/confluence/display/~davsclaus">Claus
Ibsen</a>
    </h4>
         <br/>
    <div class="notificationGreySide">
         <h2><a name="DataFormatComponent-DataFormatComponent"></a>Data
Format Component</h2>
<p><b>Available as of Camel 2.12</b></p>

<p>The <b>dataformat:</b> component allows to use <a href="/confluence/display/CAMEL/Data+Format"
title="Data Format">Data Format</a> as a Camel <a href="/confluence/display/CAMEL/Component"
title="Component">Component</a>.</p>

<h3><a name="DataFormatComponent-URIformat"></a>URI format</h3>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family:
ConfluenceInstalledFont,monospace;">
dataformat:name:(marshal|unmarshal)[?options]
</pre>
</div></div>

<p>Where <b>name</b> is the name of the <a href="/confluence/display/CAMEL/Data+Format"
title="Data Format">Data Format</a>. And then followed by the operation which must
either be <tt>marshal</tt> or <tt>unmarshal</tt>.<br/>
The options is used for configuring the <a href="/confluence/display/CAMEL/Data+Format"
title="Data Format">Data Format</a> in use. See the <a href="/confluence/display/CAMEL/Data+Format"
title="Data Format">Data Format</a> documentation for which options it support.</p>

<h3><a name="DataFormatComponent-Samples"></a>Samples</h3>

<p>For example to use the <a href="/confluence/display/CAMEL/JAXB" title="JAXB">JAXB</a>
<a href="/confluence/display/CAMEL/Data+Format" title="Data Format">Data Format</a>
we can do as follows:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family:
ConfluenceInstalledFont,monospace;">
from("activemq:My.Queue").
  to("dataformat:jaxb:unmarshal?contextPath=com.acme.model").
  to("mqseries:Another.Queue");
</pre>
</div></div>

<p>And in XML DSL you do:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: xml; gutter: false" style="font-size:12px; font-family:
ConfluenceInstalledFont,monospace;">
&lt;camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"&gt;
  &lt;route&gt;
    &lt;from uri="activemq:My.Queue"/&gt;
    &lt;to uri="dataformat:jaxb:unmarshal?contextPath=com.acme.model"/&gt;
    &lt;to uri="mqseries:Another.Queue"/&gt;
  &lt;/route&gt;
&lt;/camelContext&gt;
</pre>
</div></div>

<h3><a name="DataFormatComponent-SeeAlso"></a>See Also</h3>
<ul>
	<li><a href="/confluence/display/CAMEL/Configuring+Camel" title="Configuring Camel">Configuring
Camel</a></li>
	<li><a href="/confluence/display/CAMEL/Component" title="Component">Component</a></li>
	<li><a href="/confluence/display/CAMEL/Endpoint" title="Endpoint">Endpoint</a></li>
	<li><a href="/confluence/display/CAMEL/Getting+Started" title="Getting Started">Getting
Started</a></li>
</ul>

<ul class="alternate" type="square">
	<li><a href="/confluence/display/CAMEL/Data+Format" title="Data Format">Data
Format</a></li>
</ul>

    </div>
    <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;" class="grey">
                        <a href="https://cwiki.apache.org/confluence/users/removespacenotification.action?spaceKey=CAMEL">Stop
watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://cwiki.apache.org/confluence/users/editmyemailsettings.action">Change
email notification preferences</a>
</div>
       <a href="https://cwiki.apache.org/confluence/display/CAMEL/DataFormat+Component">View
Online</a>
              |
       <a href="https://cwiki.apache.org/confluence/display/CAMEL/DataFormat+Component?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message