Author: buildbot
Date: Fri Jul 25 13:19:10 2014
New Revision: 917378
Log:
Production update by buildbot for camel
Modified:
websites/production/camel/content/book-dataformat-appendix.html
websites/production/camel/content/book-in-one-page.html
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/rest-dsl.html
websites/production/camel/content/xstream.html
Modified: websites/production/camel/content/book-dataformat-appendix.html
==============================================================================
--- websites/production/camel/content/book-dataformat-appendix.html (original)
+++ websites/production/camel/content/book-dataformat-appendix.html Fri Jul 25
13:19:10 2014
@@ -387,7 +387,8 @@ from("activemq:My.Queue").
</div></div><p>If you would like to configure the <code>XStream</code>
instance used by the Camel for the message transformation, you can simply pass
a reference to that instance on the DSL level.</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[XStream xStream = new XStream();
xStream.aliasField("money", PurchaseOrder.class, "cash");
-
+// new Added setModel option since Camel 2.14
+xStream.setModel("NO_REFERENCES");
...
from("direct:marshal").
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 Jul 25 13:19:10
2014
@@ -4153,11 +4153,11 @@ While not actual tutorials you might fin
</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.rbtoc1406110638203 {padding: 0px;}
-div.rbtoc1406110638203 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1406110638203 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1406294273220 {padding: 0px;}
+div.rbtoc1406294273220 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1406294273220 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style></p><div class="toc-macro rbtoc1406110638203">
+/*]]>*/</style></p><div class="toc-macro rbtoc1406294273220">
<ul class="toc-indentation"><li><a shape="rect"
href="#Tutorial-JmsRemoting-TutorialonSpringRemotingwithJMS">Tutorial on Spring
Remoting with JMS</a></li><li><a shape="rect"
href="#Tutorial-JmsRemoting-Preface">Preface</a></li><li><a shape="rect"
href="#Tutorial-JmsRemoting-Prerequisites">Prerequisites</a></li><li><a
shape="rect"
href="#Tutorial-JmsRemoting-Distribution">Distribution</a></li><li><a
shape="rect" href="#Tutorial-JmsRemoting-About">About</a></li><li><a
shape="rect" href="#Tutorial-JmsRemoting-CreatetheCamelProject">Create the
Camel Project</a>
<ul class="toc-indentation"><li><a shape="rect"
href="#Tutorial-JmsRemoting-UpdatethePOMwithDependencies">Update the POM with
Dependencies</a></li></ul>
</li><li><a shape="rect" href="#Tutorial-JmsRemoting-WritingtheServer">Writing
the Server</a>
@@ -6343,11 +6343,11 @@ So we completed the last piece in the pi
<style type="text/css">/*<![CDATA[*/
-div.rbtoc1406110638442 {padding: 0px;}
-div.rbtoc1406110638442 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1406110638442 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1406294274550 {padding: 0px;}
+div.rbtoc1406294274550 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1406294274550 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style><div class="toc-macro rbtoc1406110638442">
+/*]]>*/</style><div class="toc-macro rbtoc1406294274550">
<ul class="toc-indentation"><li><a shape="rect"
href="#Tutorial-AXIS-Camel-TutorialusingAxis1.4withApacheCamel">Tutorial using
Axis 1.4 with Apache Camel</a>
<ul class="toc-indentation"><li><a shape="rect"
href="#Tutorial-AXIS-Camel-Prerequisites">Prerequisites</a></li><li><a
shape="rect"
href="#Tutorial-AXIS-Camel-Distribution">Distribution</a></li><li><a
shape="rect"
href="#Tutorial-AXIS-Camel-Introduction">Introduction</a></li><li><a
shape="rect" href="#Tutorial-AXIS-Camel-SettinguptheprojecttorunAxis">Setting
up the project to run Axis</a>
<ul class="toc-indentation"><li><a shape="rect"
href="#Tutorial-AXIS-Camel-Maven2">Maven 2</a></li><li><a shape="rect"
href="#Tutorial-AXIS-Camel-wsdl">wsdl</a></li><li><a shape="rect"
href="#Tutorial-AXIS-Camel-ConfiguringAxis">Configuring Axis</a></li><li><a
shape="rect" href="#Tutorial-AXIS-Camel-RunningtheExample">Running the
Example</a></li></ul>
@@ -10705,7 +10705,8 @@ from("activemq:My.Queue").
</div></div><p>If you would like to configure the <code>XStream</code>
instance used by the Camel for the message transformation, you can simply pass
a reference to that instance on the DSL level.</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[XStream xStream = new XStream();
xStream.aliasField("money", PurchaseOrder.class, "cash");
-
+// new Added setModel option since Camel 2.14
+xStream.setModel("NO_REFERENCES");
...
from("direct:marshal").
@@ -20134,11 +20135,11 @@ template.send("direct:alias-verify&
</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">/*<![CDATA[*/
-div.rbtoc1406110643912 {padding: 0px;}
-div.rbtoc1406110643912 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1406110643912 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1406294288675 {padding: 0px;}
+div.rbtoc1406294288675 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1406294288675 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style></p><div class="toc-macro rbtoc1406110643912">
+/*]]>*/</style></p><div class="toc-macro rbtoc1406294288675">
<ul class="toc-indentation"><li><a shape="rect" href="#CXF-CXFComponent">CXF
Component</a>
<ul class="toc-indentation"><li><a shape="rect" href="#CXF-URIformat">URI
format</a></li><li><a shape="rect" href="#CXF-Options">Options</a>
<ul class="toc-indentation"><li><a shape="rect"
href="#CXF-Thedescriptionsofthedataformats">The descriptions of the
dataformats</a>
@@ -29556,7 +29557,7 @@ ref:someName[?options]
</div></div><p>Format of restletUrl:</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[protocol://hostname[:port][/resourcePattern]
]]></script>
-</div></div><p>Restlet promotes decoupling of protocol and application
concerns. The reference implementation of <a shape="rect" class="external-link"
href="http://www.noelios.com/products/restlet-engine" rel="nofollow">Restlet
Engine</a> supports a number of protocols. However, we have tested the HTTP
protocol only. The default port is port 80. We do not automatically switch
default port based on the protocol yet.</p><p>You can append query options to
the URI in the following format,
<code>?option=value&option=value&...</code></p><h3
id="BookInOnePage-Options.64">Options</h3><div class="table-wrap"><table
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1"
class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p>Default Value</p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1"
rowspan="1"
class="confluenceTd"><p><code>headerFilterStrategy=#</code><em>refName</em></p></td><td
cols
pan="1" rowspan="1" class="confluenceTd"><p>An instance of
<code>RestletHeaderFilterStrategy</code></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Use the <code>#</code> notation
(<code>headerFilterStrategy=#</code><em>refName</em>) to reference a header
filter strategy in the Camel Registry. The strategy will be plugged into the
restlet binding if it is
<code>HeaderFilterStrategyAware</code>.</p></td></tr><tr><td colspan="1"
rowspan="1"
class="confluenceTd"><p><code>restletBinding=#</code><em>refName</em></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>An instance of
<code>DefaultRestletBinding</code></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>The bean ID of a <code>RestletBinding</code> object in
the Camel Registry.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>restletMethod</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>GET</code></p></td><td colspan="1"
rowspan="1" class="confluenceT
d"><p>On a producer endpoint, specifies the request method to use. On a
consumer endpoint, specifies that the endpoint consumes only
<code>restletMethod</code> requests. The string value is converted to <a
shape="rect" class="external-link"
href="http://www.restlet.org/documentation/1.1/api/org/restlet/data/Method.html"
rel="nofollow">org.restlet.data.Method</a> by the
<code>Method.valueOf(String)</code> method.</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>restletMethods</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><em>None</em></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Consumer only</strong>
Specify one or more methods separated by commas (e.g.
<code>restletMethods=post,put</code>) to be serviced by a restlet consumer
endpoint. If both <code>restletMethod</code> and <code>restletMethods</code>
options are specified, the <code>restletMethod</code> setting is
ignored.</p></td></tr><tr><td colspan="1" rowspa
n="1"
class="confluenceTd"><p><code>restletRealm=#</code><em>refName</em></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>The bean ID of the Realm Map in
the Camel Registry.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>restletUriPatterns=#</code><em>refName</em></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><em>None</em></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Consumer only</strong>
Specify one ore more URI templates to be serviced by a restlet consumer
endpoint, using the <code>#</code> notation to reference a
<code>List<String></code> in the Camel Registry. If a URI pattern has
been defined in the endpoint URI, both the URI pattern defined in the endpoint
and the <code>restletUriPatterns</code> option will be
honored.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>throwExceptionOnFailure<
/code> (<strong>2.6 or later</strong>)</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>true</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>*Producer only * Throws exception on a producer
failure.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>connectionTimeout</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>300000</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p><strong>Since Camel 2.12.3</strong> <strong>Producer
only</strong> The Client will give up connection if the connection is timeout,
0 for unlimited wait.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>socketTimeout</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>300000</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p><strong>Since Camel 2.12.3</strong> <strong>Producer
only</strong> The Client socket receive timeout, 0 for unlimited
wait.</p></td></tr></tbody></table></div><h3 id="BookI
nOnePage-ComponentOptions.1">Component Options</h3><p>The Restlet component
can be configured with the following options. Notice these are
<strong>component</strong> options and cannot be configured on the endpoint,
see further below for an example.</p><div class="table-wrap"><table
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1"
class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p>Default Value</p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>controllerDaemon</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong>
Indicates if the controller thread should be a daemon (not blocking JVM
exit).</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>controllerSleepTimeMs</code></p></td><td
colspan="1" ro
wspan="1" class="confluenceTd"><p><code>100</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong> Time for the
controller thread to sleep between each control.</p></td></tr><tr><td
colspan="1" rowspan="1"
class="confluenceTd"><p><code>inboundBufferSize</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>8192</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong> The size of
the buffer when reading messages.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>minThreads</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>1</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong> Minimum
threads waiting to service requests.</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>maxThreads</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>10</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong>
Maximum threads that will service requests.</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><span>lowThreads</span></td><td colspan="1"
rowspan="1" class="confluenceTd">8</td><td colspan="1" rowspan="1"
class="confluenceTd"><strong>Camel 2.13: </strong>Number of worker threads
determining when the connector is considered overloaded.</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">maxQueued</td><td colspan="1"
rowspan="1" class="confluenceTd">0</td><td colspan="1" rowspan="1"
class="confluenceTd"><strong>Camel 2.13: </strong>Maximum number of calls that
can be queued if there aren't any worker thread available to service them. If
the value is '0', then no queue is used and calls are rejected if no worker
thread is immediately available. If the value is '-1', then an unbounded queue
is used and calls are never rejected.</td></tr><tr><td colspan="1" rowspan="1"
class="confluenc
eTd"><p><code>maxConnectionsPerHost</code></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>-1</code></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p><strong>Camel 2.10:</strong> Maximum number of
concurrent connections per host (IP address).</p></td></tr><tr><td colspan="1"
rowspan="1"
class="confluenceTd"><p><code>maxTotalConnections</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>-1</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong>
Maximum number of concurrent connections in total.</p></td></tr><tr><td
colspan="1" rowspan="1"
class="confluenceTd"><p><code>outboundBufferSize</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>8192</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong> The size of
the buffer when writing messages.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>persistingConnecti
ons</code></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p><strong>Camel 2.10:</strong> Indicates if connections
should be kept alive after a call.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>pipeliningConnections</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong>
Indicates if pipelining connections are supported.</p></td></tr><tr><td
colspan="1" rowspan="1"
class="confluenceTd"><p><code>threadMaxIdleTimeMs</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>60000</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong>
Time for an idle thread to wait for an operation before being
collected.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>useForwardedForHea
der</code></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p><strong>Camel 2.10:</strong> Lookup the
"X-Forwarded-For" header supported by popular proxies and caches and uses it to
populate the Request.getClientAddresses() method result. This information is
only safe for intermediary components within your local network. Other
addresses could easily be changed by setting a fake header and should not be
trusted for serious security checks.</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>reuseAddress</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel
2.10.5/2.11.1:</strong> Enable/disable the SO_REUSEADDR socket option. See
java.io.ServerSocket#reuseAddress property for additional
details.</p></td></tr></tbody></table></div><h3
id="BookInOnePage-MessageHeaders.15">
Message Headers</h3><div class="confluenceTableSmall">
+</div></div><p>Restlet promotes decoupling of protocol and application
concerns. The reference implementation of <a shape="rect" class="external-link"
href="http://www.noelios.com/products/restlet-engine" rel="nofollow">Restlet
Engine</a> supports a number of protocols. However, we have tested the HTTP
protocol only. The default port is port 80. We do not automatically switch
default port based on the protocol yet.</p><p>You can append query options to
the URI in the following format,
<code>?option=value&option=value&...</code></p><h3
id="BookInOnePage-Options.64">Options</h3><div class="table-wrap"><table
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1"
class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p>Default Value</p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1"
rowspan="1"
class="confluenceTd"><p><code>headerFilterStrategy=#</code><em>refName</em></p></td><td
cols
pan="1" rowspan="1" class="confluenceTd"><p>An instance of
<code>RestletHeaderFilterStrategy</code></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Use the <code>#</code> notation
(<code>headerFilterStrategy=#</code><em>refName</em>) to reference a header
filter strategy in the Camel Registry. The strategy will be plugged into the
restlet binding if it is
<code>HeaderFilterStrategyAware</code>.</p></td></tr><tr><td colspan="1"
rowspan="1"
class="confluenceTd"><p><code>restletBinding=#</code><em>refName</em></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>An instance of
<code>DefaultRestletBinding</code></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>The bean ID of a <code>RestletBinding</code> object in
the Camel Registry.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>restletMethod</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>GET</code></p></td><td colspan="1"
rowspan="1" class="confluenceT
d"><p>On a producer endpoint, specifies the request method to use. On a
consumer endpoint, specifies that the endpoint consumes only
<code>restletMethod</code> requests. The string value is converted to <a
shape="rect" class="external-link"
href="http://www.restlet.org/documentation/1.1/api/org/restlet/data/Method.html"
rel="nofollow">org.restlet.data.Method</a> by the
<code>Method.valueOf(String)</code> method.</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>restletMethods</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><em>None</em></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Consumer only</strong>
Specify one or more methods separated by commas (e.g.
<code>restletMethods=post,put</code>) to be serviced by a restlet consumer
endpoint. If both <code>restletMethod</code> and <code>restletMethods</code>
options are specified, the <code>restletMethod</code> setting is
ignored.</p></td></tr><tr><td colspan="1" rowspa
n="1"
class="confluenceTd"><p><code>restletRealm=#</code><em>refName</em></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>The bean ID of the Realm Map in
the Camel Registry.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>restletUriPatterns=#</code><em>refName</em></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><em>None</em></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Consumer only</strong>
Specify one ore more URI templates to be serviced by a restlet consumer
endpoint, using the <code>#</code> notation to reference a
<code>List<String></code> in the Camel Registry. If a URI pattern has
been defined in the endpoint URI, both the URI pattern defined in the endpoint
and the <code>restletUriPatterns</code> option will be
honored.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>throwExceptionOnFailure<
/code> (<strong>2.6 or later</strong>)</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>true</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>*Producer only * Throws exception on a producer
failure.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>connectionTimeout</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>300000</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p><strong>Since Camel 2.12.3</strong> <strong>Producer
only</strong> The Client will give up connection if the connection is timeout,
0 for unlimited wait.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>socketTimeout</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>300000</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p><strong>Since Camel 2.12.3</strong> <strong>Producer
only</strong> The Client socket receive timeout, 0 for unlimited
wait.</p></td></tr><tr><td colspan="1" rowspan="1" cla
ss="confluenceTd"><code>disableStreamCache</code></td><td colspan="1"
rowspan="1" class="confluenceTd">false</td><td colspan="1" rowspan="1"
class="confluenceTd"><strong>Camel 2.14:</strong><span style="color:
rgb(0,0,0);"> Determines whether or not the raw input stream from Jetty is
cached or not (Camel will read the stream into a in memory/overflow to
file, </span><a shape="rect" class="external-link"
href="http://camel.apache.org/stream-caching.html" title="Stream
caching">Stream caching</a><span style="color: rgb(0,0,0);">) cache. By default
Camel will cache the Jetty input stream to support reading it multiple times to
ensure it Camel can retrieve all data from the stream. However you can set this
option to </span><code>true</code><span style="color:
rgb(0,0,0);"> when you for example need to access the raw stream, such as
streaming it directly to a file or other persistent store.
DefaultRestletBinding will copy the request input stream into a stream cache a
nd put it into message body if this option
is </span><code>false</code><span style="color: rgb(0,0,0);"> to
support reading the stream multiple
times.</span></td></tr></tbody></table></div><h3
id="BookInOnePage-ComponentOptions.1">Component Options</h3><p>The Restlet
component can be configured with the following options. Notice these are
<strong>component</strong> options and cannot be configured on the endpoint,
see further below for an example.</p><div class="table-wrap"><table
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1"
class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p>Default Value</p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>controllerDaemon</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</stron
g> Indicates if the controller thread should be a daemon (not blocking JVM
exit).</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>controllerSleepTimeMs</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>100</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong>
Time for the controller thread to sleep between each
control.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>inboundBufferSize</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>8192</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong> The size of
the buffer when reading messages.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>minThreads</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>1</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong> Minimum threa
ds waiting to service requests.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>maxThreads</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>10</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong> Maximum
threads that will service requests.</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><span>lowThreads</span></td><td colspan="1"
rowspan="1" class="confluenceTd">8</td><td colspan="1" rowspan="1"
class="confluenceTd"><strong>Camel 2.13: </strong>Number of worker threads
determining when the connector is considered overloaded.</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">maxQueued</td><td colspan="1"
rowspan="1" class="confluenceTd">0</td><td colspan="1" rowspan="1"
class="confluenceTd"><strong>Camel 2.13: </strong>Maximum number of calls that
can be queued if there aren't any worker thread available to service them. If
the value is '0', then no queue is use
d and calls are rejected if no worker thread is immediately available. If the
value is '-1', then an unbounded queue is used and calls are never
rejected.</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>maxConnectionsPerHost</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>-1</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong>
Maximum number of concurrent connections per host (IP
address).</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>maxTotalConnections</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>-1</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong>
Maximum number of concurrent connections in total.</p></td></tr><tr><td
colspan="1" rowspan="1"
class="confluenceTd"><p><code>outboundBufferSize</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>8192</code></p></td><td cols
pan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong> The
size of the buffer when writing messages.</p></td></tr><tr><td colspan="1"
rowspan="1"
class="confluenceTd"><p><code>persistingConnections</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong>
Indicates if connections should be kept alive after a
call.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>pipeliningConnections</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong>
Indicates if pipelining connections are supported.</p></td></tr><tr><td
colspan="1" rowspan="1"
class="confluenceTd"><p><code>threadMaxIdleTimeMs</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>60000</code></p></td><td
colspan="1" rowspan="1" class="
confluenceTd"><p><strong>Camel 2.10:</strong> Time for an idle thread to wait
for an operation before being collected.</p></td></tr><tr><td colspan="1"
rowspan="1"
class="confluenceTd"><p><code>useForwardedForHeader</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong>
Lookup the "X-Forwarded-For" header supported by popular proxies and caches and
uses it to populate the Request.getClientAddresses() method result. This
information is only safe for intermediary components within your local network.
Other addresses could easily be changed by setting a fake header and should not
be trusted for serious security checks.</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>reuseAddress</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10.5
/2.11.1:</strong> Enable/disable the SO_REUSEADDR socket option. See
java.io.ServerSocket#reuseAddress property for additional
details.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><code>disableStreamCache</code></td><td colspan="1"
rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1"
rowspan="1" class="confluenceTd"><strong>Camel 2.14:</strong><span
style="color: rgb(0,0,0);"> Determines whether or not the raw input stream
from Jetty is cached or not (Camel will read the stream into a in
memory/overflow to file, </span><a shape="rect" class="external-link"
href="http://camel.apache.org/stream-caching.html" title="Stream
caching">Stream caching</a><span style="color: rgb(0,0,0);">) cache. By default
Camel will cache the Jetty input stream to support reading it multiple times to
ensure it Camel can retrieve all data from the stream. However you can set this
option to </span><code>true</code><span style="color: rgb(0,0,0);"> 
when you for example need to access the raw stream, such as streaming it
directly to a file or other persistent store. DefaultRestletBinding will copy
the request input stream into a stream cache and put it into message body if
this option is </span><code>false</code><span style="color:
rgb(0,0,0);"> to support reading the stream multiple
times.</span></td></tr></tbody></table></div><h3
id="BookInOnePage-MessageHeaders.15">Message Headers</h3><div
class="confluenceTableSmall">
<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1"
class="confluenceTh"><p> Name </p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p> Type </p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p> Description </p></th></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p> <code>Content-Type</code> </p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> <code>String</code>
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Specifies the
content type, which can be set on the OUT message by the application/processor.
The value is the <code>content-type</code> of the response message. If this
header is not set, the content type is based on the object type of the OUT
message body. In Camel 2.3 onward, if the Content-Type header is specified in
the Camel IN message, the value of the header determine the content type for
the Restlet request message.   Otherwise, it is defaulted to
"application/x-www-form-urlencoded'. Prio
r to release 2.3, it is not possible to change the request content type
default. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>CamelAcceptContentType</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>String</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> <strong>Since Camel 2.9.3,
2.10.0:</strong> The HTTP Accept request header. </p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p> <code>CamelHttpMethod</code>
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>String</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> The HTTP request method. This is set in the IN
message header. </p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>CamelHttpQuery</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> <code>String</code> </p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> The query string of the
request URI.
It is set on the IN message by <code>DefaultRestletBinding</code> when the
restlet component receives a request. </p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p> <code>CamelHttpResponseCode</code>
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>String</code> or <code>Integer</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> The response code can be set on the OUT
message by the application/processor. The value is the response code of the
response message. If this header is not set, the response code is set by the
restlet runtime engine. </p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>CamelHttpUri</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> <code>String</code> </p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> The HTTP request URI. This is
set in the IN message header. </p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>CamelRestle
tLogin</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>String</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> Login name for basic authentication. It is set on the
IN message by the application and gets filtered before the restlet request
header by Camel. </p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>CamelRestletPassword</code> </p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> <code>String</code>
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Password name for
basic authentication. It is set on the IN message by the application and gets
filtered before the restlet request header by Camel. </p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p>
<code>CamelRestletRequest</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>Request</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> <strong>Camel 2.8:</strong> The
<code>org.re
stlet.Request</code> object which holds all request details.
</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>CamelRestletResponse</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>Response</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> <strong>Camel 2.8:</strong> The
<code>org.restlet.Response</code> object. You can use this to create responses
using the API from Restlet. See examples below. </p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p> <code>org.restlet.*</code>
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> Attributes of a Restlet
message that get propagated to Camel IN headers. </p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p>
<code>cache-control</code></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>String</code> or
<code>List<CacheDirective></code> </p>
</td><td colspan="1" rowspan="1" class="confluenceTd"><p> <strong>Camel
2.11:</strong> User can set the cache-control with the String value or the List
of CacheDirective of Restlet from the camel message header.
</p></td></tr></tbody></table>
</div><h3 id="BookInOnePage-MessageBody.4">Message Body</h3><p>Camel will
store the restlet response from the external server on the OUT body. All
headers from the IN message will be copied to the OUT message, so that headers
are preserved during routing.</p><h3
id="BookInOnePage-Samples.19">Samples</h3><h4
id="BookInOnePage-RestletEndpointwithAuthentication">Restlet Endpoint with
Authentication</h4><p>The following route starts a <code>restlet</code>
consumer endpoint that listens for <code>POST</code> requests on <a
shape="rect" class="external-link" href="http://localhost:8080"
rel="nofollow">http://localhost:8080</a>. The processor creates a response that
echoes the request body and the value of the <code>id</code> header.</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[
Modified: websites/production/camel/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.
Modified: websites/production/camel/content/rest-dsl.html
==============================================================================
--- websites/production/camel/content/rest-dsl.html (original)
+++ websites/production/camel/content/rest-dsl.html Fri Jul 25 13:19:10 2014
@@ -174,7 +174,69 @@
<p>In the embedded route you can configure the
route settings such as routeId, autoStartup and various other options you can
set on routes
today.</p><pre>.get().route().routeId("myRestRoute").autoStartup(false).transform().constant("Hello
World");</pre>
</div>
</div>
-<h3 id="RestDSL-ManagingRestservices"><span style="line-height:
1.4285715;"> </span><span style="font-size: 16.0px;line-height:
1.5625;">Managing Rest services</span></h3><p>Each of the rest service becomes
a Camel route, so in the first example we have 2 x get and 1 x post REST
service, which each become a Camel route. This makes it <em>the same</em>
from Camel to manage and run these services - as they are just Camel routes.
This means any tooling and API today that deals with Camel routes, also work
with the REST services.</p><p>This means you can use JMX to stop/start routes,
and also get the JMX metrics about the routes, such as number of message
processed, and their performance statistics.</p><h3
id="RestDSL-Example-camel-example-spark-rest-tomcat">Example -
camel-example-spark-rest-tomcat</h3><p>We provide an example that uses the REST
DSL with the <a shape="rect" href="spark-rest.html">Spark Rest</a> component
that can be deployed in web containers such as Apache T
omcat. This example defines<span style="line-height: 1.4285715;"> a
single REST service which offers a GET operation that accepts 3 different
types: plain text, json, and xml.</span></p><p>public class MySparkRouteBuilder
extends RouteBuilder { @Override public void configure() throws Exception { //
configure we want to use spark-rest as the component for the rest DSL
restConfiguration().component("spark-rest"); // use the rest DSL to define rest
services, and use embedded routes rest("/hello/{me}")
.get().consumes("text/plain") .route() .to("log:input")
.transform().simple("Hello ${header.me}").endRest()
.get().consumes("application/json") .route() .to("log:input")
.transform().simple("{ \"message\": \"Hello ${header.me}\" }").endRest()
.get().consumes("text/xml") .route() .to("log:input")
.transform().simple("<message>Hello ${header.me}</message>"); }
}</p><p>To define the REST services we use the <code>rest</code> method,
where we can setup the path, which i
s "/hello/{me}". Where me refers the a wildcard that is mapped to Camel
message header with the same key. Notice how we can refer to this header in the
embedded Camel routes where we do <a shape="rect"
href="message-translator.html">message transformation</a>. <span
style="line-height: 1.4285715;">And because we used embedded routes, we need to
define this using .route(), and to denote the end of the route, we use
.endRest() to </span><em style="line-height: 1.4285715;">go back</em><span
style="line-height: 1.4285715;"> to the Rest DSL, where we can then add the
2nd, and 3rd get service. </span></p><h3
id="RestDSL-ConfiguringRestDSL">Configuring Rest DSL</h3><p>The Rest DSL allows
to configure the following options using a builder style</p><p> </p><div
class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1"
rowspan="1" class="confluenceTh">Option</th><th colspan="1" rowspan="1"
class="confluenceTh">Default</th><th colspan="1" rowspan="1" class="co
nfluenceTh">Description</th></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">component</td><td colspan="1" rowspan="1"
class="confluenceTd"> </td><td colspan="1" rowspan="1"
class="confluenceTd">The Camel Rest component to use for the REST transport,
such as restlet, spark-rest. If no component has been explicit configured, then
Camel will lookup if there is a Camel component that integrates with the Rest
DSL, or if a <code>org.apache.camel.spi.RestConsumerFactory</code> is
registered in the registry. If either one is found, then that is being
used.</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">scheme</td><td colspan="1" rowspan="1"
class="confluenceTd">http</td><td colspan="1" rowspan="1"
class="confluenceTd">The scheme to use for exposing the REST service. Usually
http or https is supported</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">hostname</td><td colspan="1" rowspan="1"
class="confluenceTd">0.0.0.0</td><td colspan="1" r
owspan="1" class="confluenceTd">The hostname to use for exposing the REST
service.</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">port</td><td colspan="1" rowspan="1"
class="confluenceTd"> </td><td colspan="1" rowspan="1"
class="confluenceTd">The port number to use for exposing the REST
service.</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">componentProperty</td><td colspan="1" rowspan="1"
class="confluenceTd"> </td><td colspan="1" rowspan="1"
class="confluenceTd">Allows to configure as many additional properties. This is
used to configure component specific options such as for <a shape="rect"
href="restlet.html">Restlet</a> / <a shape="rect"
href="spark-rest.html">Spark-Rest</a> etc.</td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd">endpointProperty</td><td colspan="1"
rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1"
class="confluenceTd"><span>Allows to configure as many additional prope
rties. This is used to configure endpoint specific options for
<span> </span><a shape="rect"
href="restlet.html">Restlet</a><span> / </span><a shape="rect"
href="spark-rest.html">Spark-Rest</a><span> etc.</span></span></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">consumerProperty</td><td
colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1"
rowspan="1" class="confluenceTd"><span>Allows to configure as many additional
properties. This is used to configure consumer specific options for
</span><span> </span><a shape="rect"
href="restlet.html">Restlet</a><span> / </span><a shape="rect"
href="spark-rest.html">Spark-Rest</a><span> etc.</span></td></tr></tbody></table></div><p> </p><p><span
style="line-height: 1.4285715;">For example to configure to use the spark-rest
component on port 9091, then we can do as follows</span></p><div class="code
panel pdl" style="border-width: 1px;"><div class="codeContent panelC
ontent pdl">
+<h3 id="RestDSL-ManagingRestservices"><span style="line-height:
1.4285715;"> </span><span style="font-size: 16.0px;line-height:
1.5625;">Managing Rest services</span></h3><p>Each of the rest service becomes
a Camel route, so in the first example we have 2 x get and 1 x post REST
service, which each become a Camel route. This makes it <em>the same</em>
from Camel to manage and run these services - as they are just Camel routes.
This means any tooling and API today that deals with Camel routes, also work
with the REST services.</p><p>This means you can use JMX to stop/start routes,
and also get the JMX metrics about the routes, such as number of message
processed, and their performance statistics.</p><h3
id="RestDSL-BindingtoPOJOsusing">Binding to POJOs using</h3><p>The Rest DSL
supports automatic binding json/xml contents to/from POJOs using Camels <a
shape="rect" href="data-format.html">Data Format</a>. By default the binding
mode is off, meaning there is no automatic
binding happening for incoming and outgoing messages.</p><p>You may want to
use binding if you develop POJOs that maps to your REST services request and
response types. This allows you as a developer to work with the POJOs in Java
code.</p><p>The binding modes are:</p><div class="table-wrap"><table
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1"
class="confluenceTh">Binding Mode</th><th colspan="1" rowspan="1"
class="confluenceTh">Description</th></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">off</td><td colspan="1" rowspan="1"
class="confluenceTd">Binding is turned off. This is the default
option.</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">auto</td><td colspan="1" rowspan="1"
class="confluenceTd">Binding is enabled and Camel is relaxed and support json,
xml or both if the needed data formats are included in the classpath. Notice
that if for example <code>camel-jaxb</code> is not on the classpath, then XML
binding is not enabled.</td></t
r><tr><td colspan="1" rowspan="1" class="confluenceTd">json</td><td
colspan="1" rowspan="1" class="confluenceTd">Binding to/from json is enabled,
and requires a json capabile data format on the classpath. By default Camel
will use <code>json-jackson</code> as the data format.</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">xml</td><td colspan="1"
rowspan="1" class="confluenceTd">Binding to/from xml is enabled, and requires
<code>camel-jaxb</code> on the classpath.</td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd">json_xml</td><td colspan="1" rowspan="1"
class="confluenceTd">Biding to/from json and xml is enabled and requires both
data formats to be on the
classpath.</td></tr></tbody></table></div><p> </p><p>To use binding you
must include the necessary data formats on the classpath, such
as <code>camel-jaxb</code> and/or <code>camel-jackson</code>. And
then enable the binding mode. You can configure the binding mode globally on
the rest confi
guration, and then override per rest service as well.</p><p>To enable binding
you configure this in Java DSL as shown below</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[restConfiguration().component("restlet").host("localhost").port(portNum).bindingMode(RestBindingMode.auto);]]></script>
+</div></div><p>And in XML DSL</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[ <restConfiguration
bindingMode="auto" component="restlet"
port="8080"/>]]></script>
+</div></div><p> </p><p>When binding is enabled Camel will bind the
incoming and outgoing messages automatic, accordingly to the content type of
the message. If the message is json, then json binding happens; and so if the
message is xml then xml binding happens. The binding happens for incoming and
reply messages. The table below summaries what binding occurs for incoming and
reply messages. </p><div class="table-wrap"><table
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1"
class="confluenceTh">Message Body</th><th colspan="1" rowspan="1"
class="confluenceTh">Direction</th><th colspan="1" rowspan="1"
class="confluenceTh">Binding Mode</th><th colspan="1" rowspan="1"
class="confluenceTh">Message Body</th></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">XML</td><td colspan="1" rowspan="1"
class="confluenceTd">Incoming</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>auto<br clear="none">xml<br
clear="none">json_xml </p></td><td colspan="1" r
owspan="1" class="confluenceTd">POJO</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">POJO</td><td colspan="1" rowspan="1"
class="confluenceTd">Outgoing</td><td colspan="1" rowspan="1"
class="confluenceTd">auto<br clear="none">xml<br
clear="none">json_xml </td><td colspan="1" rowspan="1"
class="confluenceTd">XML</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">JSON</td><td colspan="1" rowspan="1"
class="confluenceTd">Incoming</td><td colspan="1" rowspan="1"
class="confluenceTd">auto<br clear="none">json<br
clear="none">json_xml </td><td colspan="1" rowspan="1"
class="confluenceTd">POJO</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">POJO</td><td colspan="1" rowspan="1"
class="confluenceTd">Outgoing</td><td colspan="1" rowspan="1"
class="confluenceTd">auto<br clear="none">json<br
clear="none">json_xml </td><td colspan="1" rowspan="1"
class="confluenceTd">JSON</td></tr></tbody></table></div><p> </p><p>When
using binding you m
ust also configure what POJO type to map to. This is mandatory for incoming
messages, and optional for outgoing. </p><p>For example to map from
xml/json to a pojo class <code>UserPojo</code> you do this in Java DSL as
shown below:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[// configure to use restlet on localhost with
the given port
+// and enable auto binding mode
+restConfiguration().component("restlet").host("localhost").port(portNum).bindingMode(RestBindingMode.auto);
+
+// use the rest DSL to define the rest services
+rest("/users/")
+ .post("new").type(UserPojo.class)
+ .to("direct:newUser");]]></script>
+</div></div><p>Notice we use <code>type</code> to define the incoming
type. We can optionally define an outgoing type (which can be a good idea, to
make it known from the DSL and also for tooling and JMX APIs to know both the
incoming and outgoing types of the REST services.). To define the outgoing
type, we use <code>outType</code> as shown below:</p><div class="code
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[// configure to use restlet on localhost with
the given port
+// and enable auto binding mode
+restConfiguration().component("restlet").host("localhost").port(portNum).bindingMode(RestBindingMode.auto);
+
+// use the rest DSL to define the rest services
+rest("/users/")
+ .post("new").type(UserPojo.class).outType(CountryPojo.class)
+ .to("direct:newUser");]]></script>
+</div></div><p><span style="line-height: 1.4285715;"><br
clear="none"></span></p><p><span style="line-height:
1.4285715;">The </span><code style="line-height:
1.4285715;">UserPojo</code><span style="line-height: 1.4285715;"> is just a
plain pojo with getter/setter as shown:</span></p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[public class UserPojo {
+ private int id;
+ private String name;
+ public int getId() {
+ return id;
+ }
+ public void setId(int id) {
+ this.id = id;
+ }
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+}]]></script>
+</div></div><p>The <code>UserPojo</code> only supports json, as XML
requires to use JAXB annotations, so we can add those annotations if we want to
support XML also</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[@XmlRootElement(name = "user")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class UserPojo {
+ @XmlAttribute
+ private int id;
+ @XmlAttribute
+ private String name;
+ public int getId() {
+ return id;
+ }
+ public void setId(int id) {
+ this.id = id;
+ }
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+}
+
+]]></script>
+</div></div><p>By having the JAXB annotations the POJO supports both json and
xml bindings.</p><p> </p><h3 id="RestDSL-ConfiguringRestDSL"><span
style="line-height: 1.5625;">Configuring Rest DSL</span></h3><p>The Rest DSL
allows to configure the following options using a builder
style</p><p> </p><div class="table-wrap"><table
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1"
class="confluenceTh">Option</th><th colspan="1" rowspan="1"
class="confluenceTh">Default</th><th colspan="1" rowspan="1"
class="confluenceTh">Description</th></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">component</td><td colspan="1" rowspan="1"
class="confluenceTd"> </td><td colspan="1" rowspan="1"
class="confluenceTd">The Camel Rest component to use for the REST transport,
such as restlet, spark-rest. If no component has been explicit configured, then
Camel will lookup if there is a Camel component that integrates with the Rest
DSL, or if a <code>org.apache.camel.sp
i.RestConsumerFactory</code> is registered in the registry. If either one
is found, then that is being used.</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">scheme</td><td colspan="1" rowspan="1"
class="confluenceTd">http</td><td colspan="1" rowspan="1"
class="confluenceTd">The scheme to use for exposing the REST service. Usually
http or https is supported</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">hostname</td><td colspan="1" rowspan="1"
class="confluenceTd">0.0.0.0</td><td colspan="1" rowspan="1"
class="confluenceTd">The hostname to use for exposing the REST
service.</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">port</td><td colspan="1" rowspan="1"
class="confluenceTd"> </td><td colspan="1" rowspan="1"
class="confluenceTd">The port number to use for exposing the REST
service.</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">bindingMode</td><td colspan="1" rowspan="1"
class="confluenceTd">off</td><td colspan="1
" rowspan="1" class="confluenceTd">Whether binding is in use. See further
above for more details.</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">jsonDataFormat</td><td colspan="1" rowspan="1"
class="confluenceTd"> </td><td colspan="1" rowspan="1"
class="confluenceTd">Name of specific json data format to use. By default
<code>json-jackson</code> will be used. <strong>Notice:</strong> Currently
Jackson is what we recommend and are using for testing.</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">xmlDataFormat</td><td colspan="1"
rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1"
class="confluenceTd">Name of specific XML data format to use. By default
<code>jaxb</code> will be used. <strong>Notice:</strong> Currently only
<code>jaxb</code> is supported.</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">componentProperty</td><td colspan="1" rowspan="1"
class="confluenceTd"> </td><td colspan="1" rowspan="1" class="c
onfluenceTd">Allows to configure as many additional properties. This is used
to configure component specific options such as for <a shape="rect"
href="restlet.html">Restlet</a> / <a shape="rect"
href="spark-rest.html">Spark-Rest</a> etc.</td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd">endpointProperty</td><td colspan="1"
rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1"
class="confluenceTd"><span>Allows to configure as many additional properties.
This is used to configure endpoint specific options for <span> </span><a
shape="rect" href="restlet.html">Restlet</a><span> / </span><a
shape="rect"
href="spark-rest.html">Spark-Rest</a><span> etc.</span></span></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">consumerProperty</td><td
colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1"
rowspan="1" class="confluenceTd"><span>Allows to configure as many additional
properties. This is u
sed to configure consumer specific options for </span><span> </span><a
shape="rect" href="restlet.html">Restlet</a><span> / </span><a
shape="rect"
href="spark-rest.html">Spark-Rest</a><span> etc.</span></td></tr></tbody></table></div><p> </p><p><span
style="line-height: 1.4285715;">For example to configure to use the spark-rest
component on port 9091, then we can do as follows</span></p><div class="code
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[restConfiguration().component("spark-rest").port(9091).componentProperty("foo",
"123");]]></script>
</div></div><p><span style="line-height: 1.4285715;"><br
clear="none"></span></p><p><span style="line-height: 1.4285715;">And with XML
DSL</span></p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[<restConfiguration
component="spark-rest" port="9091">
<componentProperty key="foo" value="123"/>
</restConfiguration>]]></script>
Modified: websites/production/camel/content/xstream.html
==============================================================================
--- websites/production/camel/content/xstream.html (original)
+++ websites/production/camel/content/xstream.html Fri Jul 25 13:19:10 2014
@@ -103,7 +103,8 @@ from("activemq:My.Queue").
</div></div><p>If you would like to configure the <code>XStream</code>
instance used by the Camel for the message transformation, you can simply pass
a reference to that instance on the DSL level.</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[XStream xStream = new XStream();
xStream.aliasField("money", PurchaseOrder.class, "cash");
-
+// new Added setModel option since Camel 2.14
+xStream.setModel("NO_REFERENCES");
...
from("direct:marshal").