You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by bu...@apache.org on 2017/02/10 19:20:09 UTC

svn commit: r1006521 [2/3] - in /websites/production/camel/content: book-dataformat-appendix.html book-in-one-page.html cache/main.pageCache json.html xmljson.html

Modified: websites/production/camel/content/book-in-one-page.html
==============================================================================
--- websites/production/camel/content/book-in-one-page.html (original)
+++ websites/production/camel/content/book-in-one-page.html Fri Feb 10 19:20:09 2017
@@ -3930,11 +3930,11 @@ The tutorial has been designed in two pa
 While not actual tutorials you might find working through the source of the various <a shape="rect" href="examples.html">Examples</a> useful.</li></ul>
 
 <h2 id="BookInOnePage-TutorialonSpringRemotingwithJMS">Tutorial on Spring Remoting with JMS</h2><p>&#160;</p><div class="confluence-information-macro confluence-information-macro-information"><p class="title">Thanks</p><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>This tutorial was kindly donated to Apache Camel by Martin Gilday.</p></div></div><h2 id="BookInOnePage-Preface">Preface</h2><p>This tutorial aims to guide the reader through the stages of creating a project which uses Camel to facilitate the routing of messages from a JMS queue to a <a shape="rect" class="external-link" href="http://www.springramework.org" rel="nofollow">Spring</a> service. The route works in a synchronous fashion returning a response to the client.</p><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1486664277829 {padding: 0px;}
-div.rbtoc1486664277829 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1486664277829 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1486754288315 {padding: 0px;}
+div.rbtoc1486754288315 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1486754288315 li {margin-left: 0px;padding-left: 0px;}
 
-/*]]>*/</style></p><div class="toc-macro rbtoc1486664277829">
+/*]]>*/</style></p><div class="toc-macro rbtoc1486754288315">
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-TutorialonSpringRemotingwithJMS">Tutorial on Spring Remoting with JMS</a></li><li><a shape="rect" href="#BookInOnePage-Preface">Preface</a></li><li><a shape="rect" href="#BookInOnePage-Prerequisites">Prerequisites</a></li><li><a shape="rect" href="#BookInOnePage-Distribution">Distribution</a></li><li><a shape="rect" href="#BookInOnePage-About">About</a></li><li><a shape="rect" href="#BookInOnePage-CreatetheCamelProject">Create the Camel Project</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-UpdatethePOMwithDependencies">Update the POM with Dependencies</a></li></ul>
 </li><li><a shape="rect" href="#BookInOnePage-WritingtheServer">Writing the Server</a>
@@ -6049,11 +6049,11 @@ So we completed the last piece in the pi
 <p>This example has been removed from <strong>Camel 2.9</strong> onwards. Apache Axis 1.4 is a very old and unsupported framework. We encourage users to use <a shape="rect" href="cxf.html">CXF</a> instead of Axis.</p></div></div>
 
 <style type="text/css">/*<![CDATA[*/
-div.rbtoc1486664278175 {padding: 0px;}
-div.rbtoc1486664278175 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1486664278175 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1486754288664 {padding: 0px;}
+div.rbtoc1486754288664 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1486754288664 li {margin-left: 0px;padding-left: 0px;}
 
-/*]]>*/</style><div class="toc-macro rbtoc1486664278175">
+/*]]>*/</style><div class="toc-macro rbtoc1486754288664">
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-TutorialusingAxis1.4withApacheCamel">Tutorial using Axis 1.4 with Apache Camel</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-Prerequisites">Prerequisites</a></li><li><a shape="rect" href="#BookInOnePage-Distribution">Distribution</a></li><li><a shape="rect" href="#BookInOnePage-Introduction">Introduction</a></li><li><a shape="rect" href="#BookInOnePage-SettinguptheprojecttorunAxis">Setting up the project to run Axis</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-Maven2">Maven 2</a></li><li><a shape="rect" href="#BookInOnePage-wsdl">wsdl</a></li><li><a shape="rect" href="#BookInOnePage-ConfiguringAxis">Configuring Axis</a></li><li><a shape="rect" href="#BookInOnePage-RunningtheExample">Running the Example</a></li></ul>
@@ -9671,39 +9671,43 @@ from(&quot;seda:people&quot;).marshal(df
 &lt;/dependency&gt;
 ]]></script>
 </div></div>
-<h2 id="BookInOnePage-JSON">JSON</h2><p>JSON is a <a shape="rect" href="data-format.html">Data Format</a> to marshal and unmarshal Java objects to and from <a shape="rect" class="external-link" href="http://www.json.org/" rel="nofollow">JSON</a>.</p><p>For JSON to object marshalling, Camel provides integration with three popular JSON libraries:</p><ul class="alternate"><li>The <a shape="rect" class="external-link" href="http://xstream.codehaus.org/" rel="nofollow">XStream library</a> and <a shape="rect" class="external-link" href="http://jettison.codehaus.org/" rel="nofollow">Jettsion </a></li><li>The <a shape="rect" class="external-link" href="https://github.com/FasterXML/jackson" rel="nofollow">Jackson library</a></li><li><strong>Camel 2.10:</strong> The <a shape="rect" class="external-link" href="http://code.google.com/p/google-gson/" rel="nofollow">GSon library</a></li></ul><p>Every library requires adding the special camel component (see "Dependency..." paragraphs further down)
 . By default Camel uses the XStream library.</p><div class="confluence-information-macro confluence-information-macro-tip"><p class="title">Direct, bi-directional JSON &lt;=&gt; XML conversions</p><span class="aui-icon aui-icon-small aui-iconfont-approve confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>As of Camel 2.10, Camel supports direct, bi-directional JSON &lt;=&gt; XML conversions via the <a shape="rect" href="xmljson.html">camel-xmljson</a> data format, which is documented separately.</p></div></div><h3 id="BookInOnePage-UsingJSONdataformatwiththeXStreamlibrary">Using JSON data format with the XStream library</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[// lets turn Object messages into json then send to MQSeries
-from(&quot;activemq:My.Queue&quot;).
-  marshal().json().
-  to(&quot;mqseries:Another.Queue&quot;);
-]]></script>
-</div></div><h3 id="BookInOnePage-UsingJSONdataformatwiththeJacksonlibrary">Using JSON data format with the Jackson library</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[// lets turn Object messages into json then send to MQSeries
-from(&quot;activemq:My.Queue&quot;).
-  marshal().json(JsonLibrary.Jackson).
-  to(&quot;mqseries:Another.Queue&quot;);
-]]></script>
-</div></div><h3 id="BookInOnePage-UsingJSONdataformatwiththeGSONlibrary">Using JSON data format with the GSON library</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[// lets turn Object messages into json then send to MQSeries
-from(&quot;activemq:My.Queue&quot;).
-  marshal().json(JsonLibrary.Gson).
-  to(&quot;mqseries:Another.Queue&quot;);
-]]></script>
-</div></div><h4 id="BookInOnePage-UsingJSONinSpringDSL">Using JSON in Spring DSL</h4><p>When using <a shape="rect" href="data-format.html">Data Format</a> in Spring DSL you need to declare the data formats first. This is done in the <strong>DataFormats</strong> XML tag.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[        &lt;dataFormats&gt;
-            &lt;!-- here we define a Json data format with the id jack and that it should use the TestPojo as the class type when
-                 doing unmarshal. The unmarshalTypeName is optional, if not provided Camel will use a Map as the type --&gt;
-            &lt;json id=&quot;jack&quot; library=&quot;Jackson&quot; unmarshalTypeName=&quot;org.apache.camel.component.jackson.TestPojo&quot;/&gt;
-        &lt;/dataFormats&gt;
+<h2 id="BookInOnePage-JSON">JSON</h2><p>JSON is a <a shape="rect" href="data-format.html">Data Format</a> to marshal and unmarshal Java objects to and from <a shape="rect" class="external-link" href="http://www.json.org/" rel="nofollow">JSON</a>.</p><p>For JSON to object marshalling, Camel provides integration with three popular JSON libraries:</p><ul class="alternate"><li>The <a shape="rect" class="external-link" href="http://xstream.codehaus.org/" rel="nofollow">XStream library</a> and <a shape="rect" class="external-link" href="http://jettison.codehaus.org/" rel="nofollow">Jettsion </a></li><li>The <a shape="rect" class="external-link" href="https://github.com/FasterXML/jackson" rel="nofollow">Jackson library</a></li><li><strong>Camel 2.10:</strong> The <a shape="rect" class="external-link" href="http://code.google.com/p/google-gson/" rel="nofollow">GSon library</a></li></ul><p>Every library requires adding the special camel component (see "Dependency..." paragraphs further down)
 . By default Camel uses the XStream library.</p><div class="confluence-information-macro confluence-information-macro-tip"><p class="title">Direct, bi-directional JSON &lt;=&gt; XML conversions</p><span class="aui-icon aui-icon-small aui-iconfont-approve confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>As of Camel 2.10, Camel supports direct, bi-directional JSON &lt;=&gt; XML conversions via the <a shape="rect" href="xmljson.html">camel-xmljson</a> data format, which is documented separately.</p></div></div><h3 id="BookInOnePage-UsingJSONDataFormatWiththeXStreamLibrary">Using JSON Data Format With the&#160;<code>XStream</code> Library</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[// Let&#39;s turn Object messages into JSON then send to MQSeries
+from(&quot;activemq:My.Queue&quot;)
+  .marshal().json()
+  .to(&quot;mqseries:Another.Queue&quot;);
+]]></script>
+</div></div><h3 id="BookInOnePage-UsingJSONDataFormatWiththeJacksonLibrary">Using JSON Data Format With the&#160;<code>Jackson</code> Library</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[// Let&#39;s turn Object messages into JSON then send to MQSeries
+from(&quot;activemq:My.Queue&quot;)
+  .marshal().json(JsonLibrary.Jackson)
+  .to(&quot;mqseries:Another.Queue&quot;);
+]]></script>
+</div></div><h3 id="BookInOnePage-UsingJSONDataFormatWiththeGSONLibrary">Using JSON Data Format With the GSON Library</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[// Let&#39;s turn Object messages into JSON then send to MQSeries
+from(&quot;activemq:My.Queue&quot;)
+  .marshal().json(JsonLibrary.Gson)
+  .to(&quot;mqseries:Another.Queue&quot;);
+]]></script>
+</div></div><h4 id="BookInOnePage-UsingJSONinSpringDSL">Using JSON in Spring DSL</h4><p>When using <a shape="rect" href="data-format.html">Data Format</a> in Spring DSL you need to declare the data formats first. This is done in the <strong><code>DataFormats</code></strong> XML tag.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;dataFormats&gt;
+  &lt;!-- 
+       Here we define a Json data format with the id jack and that it should use the TestPojo
+       as the class type when doing unmarshal.
+
+       The unmarshalTypeName is optional, if not provided Camel will use a Map as the type.
+  --&gt;
+  &lt;json id=&quot;jack&quot; library=&quot;Jackson&quot; unmarshalTypeName=&quot;org.apache.camel.component.jackson.TestPojo&quot;/&gt;
+&lt;/dataFormats&gt;
 ]]></script>
 </div></div><p>And then you can refer to this id in the route:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[       &lt;route&gt;
-            &lt;from uri=&quot;direct:back&quot;/&gt;
-            &lt;unmarshal ref=&quot;jack&quot;/&gt;
-            &lt;to uri=&quot;mock:reverse&quot;/&gt;
-        &lt;/route&gt;
+<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;route&gt;
+  &lt;from uri=&quot;direct:back&quot;/&gt;
+  &lt;unmarshal ref=&quot;jack&quot;/&gt;
+  &lt;to uri=&quot;mock:reverse&quot;/&gt;
+&lt;/route&gt;
 ]]></script>
-</div></div><h3 id="BookInOnePage-ExcludingPOJOfieldsfrommarshalling">Excluding POJO fields from marshalling</h3><p><strong>As of Camel 2.10</strong><br clear="none"> When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output. With Jackson you can use <a shape="rect" class="external-link" href="http://wiki.fasterxml.com/JacksonJsonViews" rel="nofollow">JSON views</a> to accomplish this. First create one or more marker classes.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="BookInOnePage-ExcludingPOJOFieldsFromMarshalling">Excluding POJO Fields From Marshalling</h3><p><strong>As of Camel 2.10</strong><br clear="none"> When marshaling a POJO to JSON you might want to exclude certain fields from the JSON output. With Jackson you can use <a shape="rect" class="external-link" href="http://wiki.fasterxml.com/JacksonJsonViews" rel="nofollow">JSON views</a> to accomplish this.</p><p>First create one or more marker classes:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 public class Views {
 
@@ -9711,7 +9715,7 @@ public class Views {
     static class Weight { }
 }
 ]]></script>
-</div></div>Use the marker classes with the <code>@JsonView</code> annotation to include/exclude certain fields. The annotation also works on getters.<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div>Second, use the marker classes with the <strong><code>@JsonView</code></strong> annotation to include/exclude certain fields. The annotation also works on getters:<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 @JsonView(Views.Age.class)
 private int age = 30;
@@ -9721,11 +9725,11 @@ private int height = 190;
 @JsonView(Views.Weight.class)
 private int weight = 70;
 ]]></script>
-</div></div>Finally use the Camel <code>JacksonDataFormat</code> to marshall the above POJO to JSON.<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div>Finally, use the Camel <strong><code>JacksonDataFormat</code></strong> to marshal the above POJO to JSON.<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 from(&quot;direct:inPojoAgeView&quot;).marshal().json(TestPojoView.class, Views.Age.class);
 ]]></script>
-</div></div>Note that the height field is missing in the resulting JSON:<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><strong>Note</strong>: the height field is missing in the resulting JSON.<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[{&quot;age&quot;:30, &quot;weight&quot;:70}
 ]]></script>
 </div></div><p>The GSON library supports a similar feature through the notion of <a shape="rect" class="external-link" href="http://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/ExclusionStrategy.html" rel="nofollow">ExclusionStrategies</a>:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
@@ -9746,20 +9750,20 @@ protected static class AgeExclusionStrat
     }
 }
 ]]></script>
-</div></div>The <code>GsonDataFormat</code> accepts an <code>ExclusionStrategy</code> in its constructor:<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div>The <strong><code>GsonDataFormat</code></strong> accepts an <strong><code>ExclusionStrategy</code></strong> in its constructor:<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 GsonDataFormat ageExclusionFormat = new GsonDataFormat(TestPojoExclusion.class);
 ageExclusionFormat.setExclusionStrategies(Arrays.&lt;ExclusionStrategy&gt;asList(new AgeExclusionStrategy()));
 from(&quot;direct:inPojoExcludeAge&quot;).marshal(ageExclusionFormat);
 ]]></script>
-</div></div>The line above will exclude fields annotated with <code>@ExcludeAge</code> when marshalling to JSON.<h3 id="BookInOnePage-Configuringfieldnamingpolicy">Configuring field naming policy</h3><p><strong>Available as of Camel 2.11</strong></p><p>The GSON library supports specifying policies and strategies for mapping from json to POJO fields. A common naming convention is to map json fields using lower case with underscores.</p><p>We may have this JSON string</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div>The line above will exclude fields annotated with <strong><code>@ExcludeAge</code></strong> when marshaling to JSON.<h3 id="BookInOnePage-ConfiguringFieldNamingPolicy">Configuring Field Naming Policy</h3><p><strong>Available as of Camel 2.11</strong></p><p>The GSON library supports specifying policies and strategies for mapping from JSON to POJO fields. A common naming convention is to map JSON fields using lower case with underscores.</p><p>We may have this JSON string</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[{
   &quot;id&quot; : 123,
   &quot;first_name&quot; : &quot;Donald&quot;
   &quot;last_name&quot; : &quot;Duck&quot;
 }
 ]]></script>
-</div></div><p>Which we want to map to a POJO that has getter/setters as</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>PersonPojo.java</b></div><div class="codeContent panelContent pdl">
+</div></div><p>Which we want to map to a POJO that has getter/setters as:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>PersonPojo.java</b></div><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[public class PersonPojo {
 
     private int id;
@@ -9791,38 +9795,39 @@ from(&quot;direct:inPojoExcludeAge&quot;
     }
 }
 ]]></script>
-</div></div><p>Then we can configure the <code>org.apache.camel.component.gson.GsonDataFormat</code> in a Spring XML files as shown below. Notice we use <code>fieldNamingPolicy</code> property to set the field mapping. This property is an enum from GSon <code>com.google.gson.FieldNamingPolicy</code> which has a number of pre defined mappings. If you need full control you can use the property <code>FieldNamingStrategy</code> and implement a custom <code>com.google.gson.FieldNamingStrategy</code> where you can control the mapping.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Configuring GsonDataFromat in Spring XML file</b></div><div class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[    &lt;!-- define the gson data format, where we configure the data format using the properties --&gt;
-    &lt;bean id=&quot;gson&quot; class=&quot;org.apache.camel.component.gson.GsonDataFormat&quot;&gt;
-        &lt;!-- we want to unmarshal to person pojo --&gt;
-        &lt;property name=&quot;unmarshalType&quot; value=&quot;org.apache.camel.component.gson.PersonPojo&quot;/&gt;
-        &lt;!-- we want to map fields to use lower case and underscores --&gt;
-        &lt;property name=&quot;fieldNamingPolicy&quot; value=&quot;LOWER_CASE_WITH_UNDERSCORES&quot;/&gt;
-    &lt;/bean&gt;
-]]></script>
-</div></div><p>And use it in Camel routes by referring to its bean id as shown:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Using gson from Camel Routes</b></div><div class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[   &lt;camelContext xmlns=&quot;http://camel.apache.org/schema/spring&quot;&gt;
+</div></div><p>Then we can configure the <strong><code>org.apache.camel.component.gson.GsonDataFormat</code></strong> in a Spring XML files as shown below. Notice we use <strong><code>fieldNamingPolicy</code></strong> property to set the field mapping. This property is an enum from GSon <strong><code>com.google.gson.FieldNamingPolicy</code></strong> which has a number of predefined mappings.</p><p>If you need full control you can use the property <strong><code>FieldNamingStrategy</code></strong> and implement a custom <strong><code>com.google.gson.FieldNamingStrategy</code></strong> where you can control the mapping.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Configuring GsonDataFromat in Spring XML file</b></div><div class="codeContent panelContent pdl">
+<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;!-- define the gson data format, where we configure the data format using the properties --&gt;
+&lt;bean id=&quot;gson&quot; class=&quot;org.apache.camel.component.gson.GsonDataFormat&quot;&gt;
 
-        &lt;route&gt;
-            &lt;from uri=&quot;direct:inPojo&quot;/&gt;
-            &lt;marshal ref=&quot;gson&quot;/&gt;
-        &lt;/route&gt;
+  &lt;!-- we want to unmarshal to person pojo --&gt;
+  &lt;property name=&quot;unmarshalType&quot; value=&quot;org.apache.camel.component.gson.PersonPojo&quot;/&gt;
 
-        &lt;route&gt;
-            &lt;from uri=&quot;direct:backPojo&quot;/&gt;
-            &lt;unmarshal ref=&quot;gson&quot;/&gt;
-        &lt;/route&gt;
+  &lt;!-- we want to map fields to use lower case and underscores --&gt;
+  &lt;property name=&quot;fieldNamingPolicy&quot; value=&quot;LOWER_CASE_WITH_UNDERSCORES&quot;/&gt;
+&lt;/bean&gt;
+]]></script>
+</div></div><p>And use it in Camel routes by referring to its bean id as shown:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Using gson from Camel Routes</b></div><div class="codeContent panelContent pdl">
+<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;camelContext xmlns=&quot;http://camel.apache.org/schema/spring&quot;&gt;
+  &lt;route&gt;
+    &lt;from uri=&quot;direct:inPojo&quot;/&gt;
+    &lt;marshal ref=&quot;gson&quot;/&gt;
+  &lt;/route&gt;
 
-    &lt;/camelContext&gt;
+  &lt;route&gt;
+    &lt;from uri=&quot;direct:backPojo&quot;/&gt;
+    &lt;unmarshal ref=&quot;gson&quot;/&gt;
+  &lt;/route&gt;
+&lt;/camelContext&gt;
 ]]></script>
-</div></div><h3 id="BookInOnePage-Include/ExcludefieldsusingthejsonViewattributewithJacksonDataFormat">Include/Exclude fields using the <code>jsonView</code> attribute with <code>JacksonDataFormat</code></h3><p><strong>Available as of Camel 2.12</strong></p><p>As an example of using this attribute you can instead of:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="BookInOnePage-Include/ExcludeFieldsUsingthejsonViewAttributeWithJacksonDataFormat">Include/Exclude Fields Using the <strong><code>jsonView</code></strong> Attribute With <code>JacksonDataFormat</code></h3><p><strong>Available as of Camel 2.12</strong></p><p>As an example of using this attribute you can instead of:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[JacksonDataFormat ageViewFormat = new JacksonDataFormat(TestPojoView.class, Views.Age.class);
-from(&quot;direct:inPojoAgeView&quot;).
-  marshal(ageViewFormat);
+
+from(&quot;direct:inPojoAgeView&quot;)
+  .marshal(ageViewFormat);
 ]]></script>
 </div></div><p>Directly specify your <a shape="rect" class="external-link" href="http://wiki.fasterxml.com/JacksonJsonViews" rel="nofollow">JSON view</a> inside the Java DSL as:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[from(&quot;direct:inPojoAgeView&quot;).
-  marshal().json(TestPojoView.class, Views.Age.class);
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[from(&quot;direct:inPojoAgeView&quot;)
+  .marshal().json(TestPojoView.class, Views.Age.class);
 ]]></script>
 </div></div><p>And the same in XML DSL:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;from uri=&quot;direct:inPojoAgeView&quot;/&gt;
@@ -9830,103 +9835,105 @@ from(&quot;direct:inPojoAgeView&quot;).
     &lt;json library=&quot;Jackson&quot; unmarshalTypeName=&quot;org.apache.camel.component.jackson.TestPojoView&quot; jsonView=&quot;org.apache.camel.component.jackson.Views$Age&quot;/&gt;
   &lt;/marshal&gt;
 ]]></script>
-</div></div><h3 id="BookInOnePage-SettingserializationincludeoptionforJacksonmarshal">Setting serialization include option for Jackson marshal</h3><p><strong>Available as of Camel 2.13.3/2.14</strong></p><p>If you want to marshal a pojo to JSON, and the pojo has some fields with null values. And you want to skip these null values, then you need to set either an annotation on the pojo,&#160;</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="BookInOnePage-SettingSerializationIncludeOptionforJacksonMarshal">Setting Serialization Include Option for Jackson Marshal</h3><p><strong>Available as of Camel 2.13.3/2.14</strong></p><p>If you want to marshal a POJO to JSON, and the&#160;POJO has some fields with null values. And you want to skip these null values, then you need to set either an annotation on the POJO,&#160;</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[@JsonInclude(Include.NON_NULL)
 public class MyPojo {
-   ...
+   // ...
 }]]></script>
-</div></div><p>But this requires you to include that annotation in your pojo source code. You can also configure the Camel JsonDataFormat to set the include option, as shown below:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>But this requires you to include that annotation in your&#160;POJO source code. You can also configure the Camel&#160;<strong><code>JsonDataFormat</code></strong> to set the include option, as shown below:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[JacksonDataFormat format = new JacksonDataFormat();
 format.setInclude(&quot;NON_NULL&quot;);]]></script>
 </div></div><p>Or from XML DSL you configure this as</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[    &lt;dataFormats&gt;
-      &lt;json id=&quot;json&quot; library=&quot;Jackson&quot; include=&quot;NON_NULL&quot;/&gt;
-    &lt;/dataFormats&gt;]]></script>
-</div></div><h3 id="BookInOnePage-UnmarshallingfromjsontoPOJOwithdynamicclassname">Unmarshalling from json to POJO with dynamic class name</h3><p><strong>Available as of Camel 2.14</strong></p><p>If you use jackson to unmarshal json to POJO, then you can now specify a header in the message that indicate which class name to unmarshal to.<br clear="none"><span style="line-height: 1.4285715;">The header has key </span><code style="line-height: 1.4285715;">CamelJacksonUnmarshalType</code><span style="line-height: 1.4285715;">&#160;if that header is present in the message, then Jackson will use that as FQN for the POJO class to unmarshal the json payload as. Notice that behavior is enabled out of the box from Camel 2.14 onwards.&#160;</span></p><p><span style="line-height: 1.4285715;">&#160;</span><span style="line-height: 1.4285715;">For JMS end users there is the JMSType header from the JMS spec that indicates that also. To enable support for JMSType you would need to turn that on, on 
 the jackson data format as shown:</span></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;dataFormats&gt;
+  &lt;json id=&quot;json&quot; library=&quot;Jackson&quot; include=&quot;NON_NULL&quot;/&gt;
+&lt;/dataFormats&gt;]]></script>
+</div></div><h3 id="BookInOnePage-UnmarshalingfromJSONtoPOJOwithDynamicClassName">Unmarshaling from JSON to POJO with Dynamic Class Name</h3><p><strong>Available as of Camel 2.14</strong></p><p>If you use Jackson to unmarshal JSON to POJO, then you can now specify a header in the message that indicate which class name to unmarshal to.<span style="line-height: 1.4285715;"> The header has key </span><strong><code style="line-height: 1.4285715;">CamelJacksonUnmarshalType</code></strong><span style="line-height: 1.4285715;">&#160;if that header is present in the message, then Jackson will use that as FQN for the POJO class to unmarshal the JSON payload as. Notice that behavior is enabled out of the box from <strong>Camel 2.14</strong>.&#160;</span></p><p><span style="line-height: 1.4285715;">&#160;</span><span style="line-height: 1.4285715;">For JMS end users there is the&#160;<strong><code>JMSType</code></strong> header from the JMS spec that indicates that also. To enable support for&
 #160;<span><strong><code>JMSType</code></strong></span> you would need to turn that on, on the Jackson data format as shown:</span></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[JacksonDataFormat format = new JacksonDataFormat();
 format.setAllowJmsType(true);]]></script>
 </div></div><p>Or from XML DSL you configure this as</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[    &lt;dataFormats&gt;
-      &lt;json id=&quot;json&quot; library=&quot;Jackson&quot; allowJmsType=&quot;true&quot;/&gt;
-    &lt;/dataFormats&gt;]]></script>
-</div></div><h3 id="BookInOnePage-UnmarshallingfromjsontoList&lt;Map&gt;orList&lt;pojo&gt;">Unmarshalling from json to List&lt;Map&gt; or List&lt;pojo&gt;</h3><p><strong>Available as of Camel 2.14</strong></p><p>If you are using Jackson to unmarshal json to a list of map/pojo, you can now specify this by setting&#160;<code>useList="true"</code> or use the&#160;<code>org.apache.camel.component.jackson.ListJacksonDataFormat</code>. For example with Java you can do as shown below:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;dataFormats&gt;
+  &lt;json id=&quot;json&quot; library=&quot;Jackson&quot; allowJmsType=&quot;true&quot;/&gt;
+&lt;/dataFormats&gt;]]></script>
+</div></div><h3 id="BookInOnePage-UnmarshalingFromJSONtoList&lt;Map&gt;orList&lt;pojo&gt;">Unmarshaling From JSON to&#160;<code>List&lt;Map&gt;</code> or&#160;<code>List&lt;pojo&gt;</code></h3><p><strong>Available as of Camel 2.14</strong></p><p>If you are using Jackson to unmarshal JSON to a list of map/POJO, you can now specify this by setting&#160;<strong><code>useList="true"</code></strong> or use the&#160;<strong><code>org.apache.camel.component.jackson.ListJacksonDataFormat</code></strong>.</p><p>For example, with Java you can do as shown below:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[JacksonDataFormat format = new ListJacksonDataFormat();
 // or
 JacksonDataFormat format = new JacksonDataFormat();
 format.useList();
+
 // and you can specify the pojo class type also
 format.setUnmarshalType(MyPojo.class);]]></script>
 </div></div><p>And if you use XML DSL then you configure to use list using <code>useList</code> attribute as shown below:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[    &lt;dataFormats&gt;
-      &lt;json id=&quot;json&quot; library=&quot;Jackson&quot; useList=&quot;true&quot;/&gt;
-    &lt;/dataFormats&gt;]]></script>
+<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;dataFormats&gt;
+  &lt;json id=&quot;json&quot; library=&quot;Jackson&quot; useList=&quot;true&quot;/&gt;
+&lt;/dataFormats&gt;]]></script>
 </div></div><p>And you can specify the pojo type also</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[    &lt;dataFormats&gt;
-      &lt;json id=&quot;json&quot; library=&quot;Jackson&quot; useList=&quot;true&quot; unmarshalTypeName=&quot;com.foo.MyPojo&quot;/&gt;
-    &lt;/dataFormats&gt;]]></script>
-</div></div><h3 id="BookInOnePage-UsingcustomJacksonObjectMapper">Using custom Jackson ObjectMapper</h3><p><strong>Available as of Camel 2.17</strong></p><p>You can use custom Jackson ObjectMapper instance, can be configured as shown below.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[    &lt;dataFormats&gt;
-      &lt;json id=&quot;json&quot; library=&quot;Jackson&quot; objectMapper=&quot;myMapper&quot;/&gt;
-    &lt;/dataFormats&gt;]]></script>
-</div></div><p>Where myMapper is the id of the custom instance that Camel will lookup in the&#160;<a shape="rect" href="registry.html">Registry</a></p><h3 id="BookInOnePage-UsingcustomJacksonmodules">Using custom Jackson modules</h3><p><strong>Available as of Camel 2.15</strong></p><p>You can use custom Jackson modules by specifying the class names of those using the moduleClassNames option as shown below.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[    &lt;dataFormats&gt;
-      &lt;json id=&quot;json&quot; library=&quot;Jackson&quot; useList=&quot;true&quot; unmarshalTypeName=&quot;com.foo.MyPojo&quot; moduleClassNames=&quot;com.foo.MyModule,com.foo.MyOtherModule&quot;/&gt;
-    &lt;/dataFormats&gt;]]></script>
-</div></div><p>When using&#160;moduleClassNames then the custom jackson modules are not configured, by created using default constructor and used as-is. If a custom module needs any custom configuration, then an instance of the module can be created and configured, and then use modulesRefs to refer to the module as shown below:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[    &lt;bean id=&quot;myJacksonModule&quot; class=&quot;com.foo.MyModule&quot;&gt;
-      ... // configure the module as you want
-    &lt;/bean&gt;
+<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;dataFormats&gt;
+  &lt;json id=&quot;json&quot; library=&quot;Jackson&quot; useList=&quot;true&quot; unmarshalTypeName=&quot;com.foo.MyPojo&quot;/&gt;
+&lt;/dataFormats&gt;]]></script>
+</div></div><h3 id="BookInOnePage-UsingCustomJackson'sObjectMapper">Using Custom Jackson's <code>ObjectMapper</code></h3><p><strong>Available from Camel 2.17</strong></p><p>You can use custom Jackson&#160;<strong><code>ObjectMapper</code></strong> instance, can be configured as shown below.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;dataFormats&gt;
+  &lt;json id=&quot;json&quot; library=&quot;Jackson&quot; objectMapper=&quot;myMapper&quot;/&gt;
+&lt;/dataFormats&gt;]]></script>
+</div></div><p>Where&#160;<strong><code>myMapper</code></strong> is the id of the custom instance that Camel will lookup in the&#160;<a shape="rect" href="registry.html">Registry.</a></p><h3 id="BookInOnePage-UsingCustomJacksonModules">Using Custom Jackson Modules</h3><p><strong>Available as of Camel 2.15</strong></p><p>You can use custom Jackson modules by specifying the class names of those using the&#160;<strong><code>moduleClassNames</code></strong> option as shown below.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;dataFormats&gt;
+  &lt;json id=&quot;json&quot; library=&quot;Jackson&quot; useList=&quot;true&quot; unmarshalTypeName=&quot;com.foo.MyPojo&quot; moduleClassNames=&quot;com.foo.MyModule,com.foo.MyOtherModule&quot;/&gt;
+&lt;/dataFormats&gt;]]></script>
+</div></div><p>When using&#160;<strong><code>moduleClassNames</code></strong> then the custom Jackson modules are not configured, by created using default constructor and used as-is. If a custom module needs any custom configuration, then an instance of the module can be created and configured, and then use&#160;<strong><code>modulesRefs</code></strong> to refer to the module as shown below:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;bean id=&quot;myJacksonModule&quot; class=&quot;com.foo.MyModule&quot;&gt;
+  ... // configure the module as you want
+&lt;/bean&gt;
  
-    &lt;dataFormats&gt;
-      &lt;json id=&quot;json&quot; library=&quot;Jackson&quot; useList=&quot;true&quot; unmarshalTypeName=&quot;com.foo.MyPojo&quot; moduleRefs=&quot;myJacksonModule&quot;/&gt;
-    &lt;/dataFormats&gt;]]></script>
-</div></div><p>&#160;Multiple modules can be specified separated by comma, such as moduleRefs="myJacksonModule,myOtherModule"</p><h3 id="BookInOnePage-EnablingordisablefeaturesusingJackson">Enabling or disable features using Jackson</h3><p><strong>Available as of Camel 2.15</strong></p><p>Jackson has a number of features you can enable or disable, which its ObjectMapper uses. For example to disable failing on unknown properties when marshalling, you can configure this using the disableFeatures:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ &lt;dataFormats&gt;
-      &lt;json id=&quot;json&quot; library=&quot;Jackson&quot; unmarshalTypeName=&quot;com.foo.MyPojo&quot; disableFeatures=&quot;FAIL_ON_UNKNOWN_PROPERTIES&quot;/&gt;
- &lt;/dataFormats&gt;]]></script>
-</div></div><p>You can disable multiple features by separating the values using comma. The values for the features must be the name of the enums from Jackson from the following enum classes</p><ul><li>com.fasterxml.jackson.databind.SerializationFeature</li><li>com.fasterxml.jackson.databind.DeserializationFeature</li><li>com.fasterxml.jackson.databind.MapperFeature</li></ul><p>To enable a feature use the enableFeatures options instead.</p><p>From Java code you can use the type safe methods from camel-jackson module:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+&lt;dataFormats&gt;
+  &lt;json id=&quot;json&quot; library=&quot;Jackson&quot; useList=&quot;true&quot; unmarshalTypeName=&quot;com.foo.MyPojo&quot; moduleRefs=&quot;myJacksonModule&quot;/&gt;
+&lt;/dataFormats&gt;]]></script>
+</div></div><p>&#160;Multiple modules can be specified separated by comma, such as <strong><code>moduleRefs="myJacksonModule,myOtherModule"</code></strong>.</p><h3 id="BookInOnePage-EnablingorDisableFeaturesUsingJackson">Enabling or Disable Features Using Jackson</h3><p><strong>Available as of Camel 2.15</strong></p><p>Jackson has a number of features you can enable or disable, which its&#160;<strong><code>ObjectMapper</code></strong> uses. For example to disable failing on unknown properties when marshaling, you can configure this using the <strong><code>disableFeatures</code></strong>:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;dataFormats&gt;
+  &lt;json id=&quot;json&quot; library=&quot;Jackson&quot; unmarshalTypeName=&quot;com.foo.MyPojo&quot; disableFeatures=&quot;FAIL_ON_UNKNOWN_PROPERTIES&quot;/&gt;
+&lt;/dataFormats&gt;]]></script>
+</div></div><p>You can disable multiple features by separating the values using comma. The values for the features must be the name of the enums from Jackson from the following enum classes</p><ul><li><code>com.fasterxml.jackson.databind.SerializationFeature</code></li><li><code>com.fasterxml.jackson.databind.DeserializationFeature</code></li><li><code>com.fasterxml.jackson.databind.MapperFeature</code></li></ul><p>To enable a feature use the&#160;<strong><code>enableFeatures</code></strong> options instead.</p><p>From Java code you can use the type safe methods from&#160;<strong><code>camel-jackson</code></strong> module:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[JacksonDataFormat df = new JacksonDataFormat(MyPojo.class);
 df.disableFeature(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
 df.disableFeature(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES);]]></script>
-</div></div><h3 id="BookInOnePage-ConvertingMapstoPOJOusingJackson">Converting Maps to POJO using Jackson</h3><p>Available since <strong>Camel 2.16</strong>. Jackson <code>ObjectMapper</code> can be used to convert maps to POJO objects. Jackson component comes with the data converter that can be used to convert <code>java.util.Map</code> instance to non-String, non-primitive and non-Number objects.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="BookInOnePage-ConvertingMapstoPOJOUsingJackson">Converting Maps to POJO Using Jackson</h3><p>Available since <strong>Camel 2.16</strong>. Jackson <strong><code>ObjectMapper</code></strong> can be used to convert maps to POJO objects. Jackson component comes with the data converter that can be used to convert <strong><code>java.util.Map</code></strong> instance to non-String, non-primitive and non-Number objects.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[Map&lt;String, Object&gt; invoiceData = new HashMap&lt;String, Object&gt;();
 invoiceData.put(&quot;netValue&quot;, 500);
 producerTemplate.sendBody(&quot;direct:mapToInvoice&quot;, invoiceData);
 ...
 // Later in the processor
 Invoice invoice = exchange.getIn().getBody(Invoice.class);]]></script>
-</div></div><p>If there is a single <code>ObjectMapper</code> instance available in the Camel registry, it will used by the converter to perform the conversion. Otherwise the default mapper will be used. &#160;</p><h3 id="BookInOnePage-FormattedJSONmarshalling(pretty-printing)">Formatted JSON marshalling (pretty-printing)</h3><p><strong>Available as of Camel 2.16</strong></p><p>Using the <code>prettyPrint</code> option&#160;one can output a well formatted JSON while marshalling:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ &lt;dataFormats&gt;
-      &lt;json id=&quot;xstream&quot; prettyPrint=&quot;true&quot;/&gt;
-      &lt;json id=&quot;jackson&quot; prettyPrint=&quot;true&quot; library=&quot;Jackson&quot;/&gt;
-      &lt;json id=&quot;gson&quot; prettyPrint=&quot;true&quot; library=&quot;Gson&quot;/&gt;
- &lt;/dataFormats&gt;]]></script>
+</div></div><p>If there is a single <strong><code>ObjectMapper</code></strong> instance available in the Camel registry, it will used by the converter to perform the conversion. Otherwise the default mapper will be used. &#160;</p><h3 id="BookInOnePage-FormattedJSONmarshalling(pretty-printing)">Formatted JSON marshalling (pretty-printing)</h3><p><strong>Available as of Camel 2.16</strong></p><p>Using the <strong><code>prettyPrint</code></strong> option&#160;one can output a well formatted JSON while marshaling:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;dataFormats&gt;
+  &lt;json id=&quot;xstream&quot; prettyPrint=&quot;true&quot;/&gt;
+  &lt;json id=&quot;jackson&quot; prettyPrint=&quot;true&quot; library=&quot;Jackson&quot;/&gt;
+  &lt;json id=&quot;gson&quot; prettyPrint=&quot;true&quot; library=&quot;Gson&quot;/&gt;
+&lt;/dataFormats&gt;]]></script>
 </div></div><p><span style="line-height: 1.5625;">And in Java DSL:</span></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[from(&quot;direct:inPretty&quot;).marshal().json(true);
  
 from(&quot;direct:inPretty&quot;).marshal().json(JsonLibrary.Jackson, true);
  
 from(&quot;direct:inPretty&quot;).marshal().json(JsonLibrary.Gson, true);]]></script>
-</div></div><p><span style="line-height: 1.5625;">Please note that as of Camel 2.16 there&#8217;re 5 different overloaded <code>json()</code> DSL methods which support the <code>prettyPrint</code> option in combination with other settings for <code>JsonLibrary</code>, <code>unmarshalType</code>, <code>jsonView</code> etc.&#160;</span></p><h3 id="BookInOnePage-"><span style="line-height: 1.5625;">&#160;</span></h3><h3 id="BookInOnePage-IntegratingJacksonwithCamel'sTypeConverters">Integrating Jackson with Camel's&#160;TypeConverters</h3><h3 id="BookInOnePage-.1"><span style="line-height: 1.5625;">&#160;</span></h3><p><strong>Available as of Camel 2.17</strong></p><p><span style="line-height: 1.5625;">The&#160;<code>camel-jackson</code> module allows to integrate Jackson as a&#160;<a shape="rect" href="type-converter.html">Type Converter</a> in the Camel registry. This works in similar ways that&#160;<code>camel-jaxb</code>&#160;integrates with the type converter as well. However&#160;
 <code>camel-jackson</code> must be explicit enabled, which is done by setting some options on the&#160;<code>CamelContext</code> properties, as shown below:</span></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[// enable Jackson json type converter
+</div></div><p><span style="line-height: 1.5625;">Please note that as of Camel 2.16 there are five different overloaded <strong><code>json()</code></strong> DSL methods which support the <strong><code>prettyPrint</code></strong> option in combination with other settings for <strong><code>JsonLibrary</code></strong>, <strong><code>unmarshalType</code></strong>, <strong><code>jsonView</code></strong> etc.&#160;</span></p><h3 id="BookInOnePage-IntegratingJacksonwithCamel'sTypeConverters"><span style="line-height: 1.5625;">&#160;</span>Integrating Jackson with Camel's&#160;TypeConverters</h3><h3 id="BookInOnePage-AvailableasofCamel2.17"><span style="line-height: 1.5625;">&#160;</span><strong>Available as of Camel 2.17</strong></h3><p><span style="line-height: 1.5625;">The&#160;<strong><code>camel-jackson</code></strong> module allows to integrate Jackson as a&#160;<a shape="rect" href="type-converter.html">Type Converter</a> in the Camel registry. This works in similar ways that&#160;<s
 trong><code>camel-jaxb</code></strong>&#160;integrates with the type converter as well. However&#160;<strong><code>camel-jackson</code></strong> must be explicit enabled, which is done by setting some options on the&#160;<strong><code>CamelContext</code></strong> properties, as shown below:</span></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[// Enable Jackson JSON type converter.
 getContext().getProperties().put(&quot;CamelJacksonEnableTypeConverter&quot;, &quot;true&quot;);
-// allow Jackson json to convert to pojo types also (by default jackson only converts to String and other simple types)
+
+// Allow Jackson JSON to convert to pojo types also (by default Jackson only converts to String and other simple types).
 getContext().getProperties().put(&quot;CamelJacksonTypeConverterToPojo&quot;, &quot;true&quot;);]]></script>
-</div></div><p>The&#160;<code>camel-jackson</code> type converter integrates with JAXB which means you can annotate POJO class with&#160;JAXB annotations that Jackson can leverage.&#160;</p><p><span style="line-height: 1.5625;"><br clear="none"></span></p><h3 id="BookInOnePage-DependenciesforXStream"><span style="line-height: 1.5625;">Dependencies for XStream</span></h3><p>To use JSON in your camel routes you need to add the a dependency on <strong>camel-xstream</strong> which implements this data format.</p><p>If you use maven you could just add the following to your pom.xml, substituting the version number for the latest &amp; greatest release (see <a shape="rect" href="download.html">the download page for the latest versions</a>).</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>The&#160;<strong><code>camel-jackson</code></strong> type converter integrates with JAXB which means you can annotate POJO class with&#160;JAXB annotations that Jackson can leverage.&#160;</p><h3 id="BookInOnePage-DependenciesforXStream"><span style="line-height: 1.5625;">Dependencies for XStream</span></h3><p>To use JSON in your camel routes you need to add the a dependency on&#160;<strong><code>camel-xstream</code></strong> which implements this data format.</p><p>If you use maven you could just add the following to your <strong><code>pom.xml</code></strong>, substituting the version number for the latest &amp; greatest release (see <a shape="rect" href="download.html">the download page for the latest versions</a>).</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;dependency&gt;
   &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
   &lt;artifactId&gt;camel-xstream&lt;/artifactId&gt;
   &lt;version&gt;2.9.2&lt;/version&gt;
 &lt;/dependency&gt;
 ]]></script>
-</div></div><h3 id="BookInOnePage-DependenciesforJackson">Dependencies for Jackson</h3><p>To use JSON in your camel routes you need to add the a dependency on <strong>camel-jackson</strong> which implements this data format.</p><p>If you use maven you could just add the following to your pom.xml, substituting the version number for the latest &amp; greatest release (see <a shape="rect" href="download.html">the download page for the latest versions</a>).</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="BookInOnePage-DependenciesforJackson">Dependencies for Jackson</h3><p>To use JSON in your camel routes you need to add the a dependency on&#160;<strong><code>camel-jackson</code></strong> which implements this data format.</p><p>If you use maven you could just add the following to your <strong><code>pom.xml</code></strong>, substituting the version number for the latest &amp; greatest release (see <a shape="rect" href="download.html">the download page for the latest versions</a>).</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;dependency&gt;
   &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
   &lt;artifactId&gt;camel-jackson&lt;/artifactId&gt;
   &lt;version&gt;2.9.2&lt;/version&gt;
 &lt;/dependency&gt;
 ]]></script>
-</div></div><h3 id="BookInOnePage-DependenciesforGSON">Dependencies for GSON</h3><p>To use JSON in your camel routes you need to add the a dependency on <strong>camel-gson</strong> which implements this data format.</p><p>If you use maven you could just add the following to your pom.xml, substituting the version number for the latest &amp; greatest release (see <a shape="rect" href="download.html">the download page for the latest versions</a>).</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="BookInOnePage-DependenciesforGSON">Dependencies for GSON</h3><p>To use JSON in your camel routes you need to add the a dependency on&#160;<strong><code>camel-gson</code></strong> which implements this data format.</p><p>If you use maven you could just add the following to your <strong><code>pom.xml</code></strong>, substituting the version number for the latest &amp; greatest release (see <a shape="rect" href="download.html">the download page for the latest versions</a>).</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;dependency&gt;
   &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
   &lt;artifactId&gt;camel-gson&lt;/artifactId&gt;
@@ -14234,8 +14241,8 @@ cometds://localhost:8443/service/mychann
  <div class="confluence-information-macro-body">
   <p>When using CXF in streaming modes (see DataFormat option), then also read about <a shape="rect" href="stream-caching.html">Stream caching</a>.</p>
  </div>
-</div><p>The <strong>cxf:</strong> component provides integration with <a shape="rect" href="http://cxf.apache.org">Apache CXF</a> for connecting to JAX-WS services hosted in CXF.</p><p><style type="text/css">/**/ div.rbtoc1486664297814 {padding: 0px;} div.rbtoc1486664297814 ul {list-style: disc;margin-left: 0px;} div.rbtoc1486664297814 li {margin-left: 0px;padding-left: 0px;} /**/</style>
- </p><div class="toc-macro rbtoc1486664297814"> 
+</div><p>The <strong>cxf:</strong> component provides integration with <a shape="rect" href="http://cxf.apache.org">Apache CXF</a> for connecting to JAX-WS services hosted in CXF.</p><p><style type="text/css">/**/ div.rbtoc1486754314992 {padding: 0px;} div.rbtoc1486754314992 ul {list-style: disc;margin-left: 0px;} div.rbtoc1486754314992 li {margin-left: 0px;padding-left: 0px;} /**/</style>
+ </p><div class="toc-macro rbtoc1486754314992"> 
   <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-CXFComponent">CXF Component</a> 
     <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-URIformat">URI format</a></li><li><a shape="rect" href="#BookInOnePage-Options">Options</a> 
       <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-Thedescriptionsofthedataformats">The descriptions of the dataformats</a> 
@@ -19703,7 +19710,7 @@ cometds://localhost:8443/service/mychann
  <div class="codeContent panelContent pdl"> 
   <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"> &amp;lt;route&amp;gt; &amp;lt;from uri=&amp;quot;timer://foo?fixedRate=true&amp;amp;amp;period=60000&amp;quot;/&amp;gt; &amp;lt;to uri=&amp;quot;bean:myBean?method=someMethodName&amp;quot;/&amp;gt; &amp;lt;/route&amp;gt; </script> 
  </div>
-</div><h4 id="BookInOnePage-Firingassoonaspossible">Firing as soon as possible</h4><h4 id="BookInOnePage-AvailableasofCamel2.17">Available as of Camel 2.17</h4><p>You may want to fire messages in a Camel route as soon as possible you can use a negative delay:</p><div class="code panel pdl" style="border-width: 1px;">
+</div><h4 id="BookInOnePage-Firingassoonaspossible">Firing as soon as possible</h4><h4 id="BookInOnePage-AvailableasofCamel2.17.1">Available as of Camel 2.17</h4><p>You may want to fire messages in a Camel route as soon as possible you can use a negative delay:</p><div class="code panel pdl" style="border-width: 1px;">
  <div class="codeContent panelContent pdl"> 
   <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"> &amp;lt;route&amp;gt; &amp;lt;from uri=&amp;quot;timer://foo?delay=-1&amp;quot;/&amp;gt; &amp;lt;to uri=&amp;quot;bean:myBean?method=someMethodName&amp;quot;/&amp;gt; &amp;lt;/route&amp;gt;</script> 
  </div>

Modified: websites/production/camel/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.