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 2019/03/31 15:23:09 UTC
svn commit: r1042911 [23/48] - in /websites/production/camel/content: ./
2007/08/17/ 2008/04/08/ 2008/04/28/ 2009/01/19/ 2009/10/26/ 2012/01/17/
2012/03/01/ 2019/03/ 2019/03/31/
Modified: websites/production/camel/content/cxfrs.html
==============================================================================
--- websites/production/camel/content/cxfrs.html (original)
+++ websites/production/camel/content/cxfrs.html Sun Mar 31 15:23:07 2019
@@ -86,7 +86,7 @@
</plain-text-body><h3 id="CXFRS-URIformat">URI format</h3><parameter ac:name="language">java</parameter><plain-text-body>cxfrs://address?options
</plain-text-body><p>Where <strong>address</strong> represents the CXF endpoint's address</p><parameter ac:name="language">java</parameter><plain-text-body>cxfrs:bean:rsEndpoint
</plain-text-body><p>Where <strong>rsEndpoint</strong> represents the spring bean's name which presents the CXFRS client or server</p><p>For either style above, you can append options to the URI as follows:</p><parameter ac:name="language">java</parameter><plain-text-body>cxfrs:bean:cxfEndpoint?resourceClasses=org.apache.camel.rs.Example
-</plain-text-body><h3 id="CXFRS-Options">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>Description</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Example</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Required?</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>default value</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>resourceClasses</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The resource classes which you want to export as REST service. Multiple classes can be separated by comma.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>resourceClasses=org.apache.camel.rs.Example1,</code><br clear="none"> <code>org.apache.camel.rs.Exchange2</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspa
n="1" class="confluenceTd"><p><em>None</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>resourceClass</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Deprecated</strong>: Use <code>resourceClasses</code> The resource class which you want to export as REST service.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>resourceClass =org.apache.camel.rs.Example1</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>None</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>httpClientAPI</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>new to Camel 2.1</strong> If it is true, the CxfRsProducer will use the HttpClientAPI to invoke the service <br clear="none" class="atl-forced-newline"> If it is false, the CxfRsProducer will use the ProxyClientAPI to invoke the service</p></td><td colspan
="1" rowspan="1" class="confluenceTd"><p>httpClientAPI=true</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>true</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>synchronous</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>This option will let you decide to use sync or async API to do the underlying work. The default value is false which means it will try to use async API by default.</p><p>This option is available as of <strong>2.5</strong> for CxfRsConsumer and as of <strong>2.19</strong> for CxfRsProducer.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>synchronous=true</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>false</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>throwExceptionOnFailure</code></p></td><td colspan="1" rowspan="1" class="
confluenceTd"><p>New in 2.6, this option tells the CxfRsProducer to inspect return codes and will generate an Exception if the return code is larger than 207.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>throwExceptionOnFailure=true</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>true</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>maxClientCacheSize</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>New in 2.6, you can set a IN message header CamelDestinationOverrideUrl to dynamically override the target destination Web Service or REST Service defined in your routes.  The implementation caches CXF clients or ClientFactoryBean in CxfProvider and CxfRsProvider.  This option allows you to configure the maximum size of the cache.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>maxClientCacheSize=5</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>10</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>setDefaultBus</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>New in 2.9.0. <strong>deprecated</strong> use defaultBus option from Camel 2.16 onwards. Will set the default bus when CXF endpoint create a bus by itself</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>setDefaultBus=true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>false</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>defaultBus</code></td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.16:</strong> <span>Will set the default bus when CXF endpoint create a bus by itself</span></td><td colspan="1" rowspan="1" class="confluenceTd"><code>defaultBus=true</code></td><td colspan="1" rowspan="1" c
lass="confluenceTd">No</td><td colspan="1" rowspan="1" class="confluenceTd"><em>false</em></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>bus</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>New in 2.9.0. A default bus created by CXF Bus Factory. Use <code>#</code> notation to reference a bus object from the registry. The referenced object must be an instance of <code>org.apache.cxf.Bus</code>.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>bus=#busName</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>None</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>bindingStyle</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>As of 2.11</strong>. Sets how requests and responses will be mapped to/from Camel. Two values are possible:</p><ul class="alternate"><li><code>SimpleConsumer</code> =>
see the <a shape="rect" href="#CXFRS-ConsumingaRESTRequest-SimpleBindingStyle">Consuming a REST Request with the Simple Binding Style</a> below.</li><li><code>Default</code> => the default style. For consumers this passes on a <code>MessageContentsList</code> to the route, requiring low-level processing in the route.</li><li><span style="font-family: monospace;">Custom</span> => allows you to specify a custom binding through the <code>binding</code> option.</li></ul></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>bindingStyle=SimpleConsumer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>Default</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code><span>binding</span></code></p></td><td colspan="1" rowspan="1" class="confluenceTd">Allows you to specify a custom <code>CxfRsBinding</code> implementation to perform low-level processing of the raw CXF req
uest and response objects. The implementation must be bound in the Camel registry, and you must use the hash (#) notation to refer to it.</td><td colspan="1" rowspan="1" class="confluenceTd"><code><span>binding=#myBinding</span></code></td><td colspan="1" rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" class="confluenceTd"><code>DefaultCxfRsBinding</code></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code><span style="line-height: 1.4285715;">providers</span></code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong style="line-height: 1.4285715;">Since Camel 2.12.2</strong><span style="line-height: 1.4285715;"> set custom JAX-RS providers list to the CxfRs endpoint.</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>providers=#MyProviders</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em style="line-height: 1.4285715;">No
ne</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code><span style="line-height: 1.4285715;">schemaLocations</span></code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong style="line-height: 1.4285715;">Since Camel 2.12.2</strong><span style="line-height: 1.4285715;"> Sets the locations of the schemas which can be used to validate the incoming XML or JAXB-driven JSON.</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>schemaLocations=#MySchemaLocations</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em style="line-height: 1.4285715;">None</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code><span style="line-height: 1.4285715;">features</span></code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong style="line-height: 1.4285715;">Since Camel 2.12.3</strong><span style="line-height: 1.428
5715;"> Set the feature list to the CxfRs endpoint.</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>features=#MyFeatures</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em style="line-height: 1.4285715;">None</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>properties</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong style="line-height: 1.4285715;">Since Camel 2.12.4</strong><span style="line-height: 1.4285715;"> Set the properties to the CxfRs endpoint.</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>properties=#MyProperties</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em style="line-height: 1.4285715;">None</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>inInterceptors</code></p>
</td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong style="line-height: 1.4285715;">Since Camel 2.12.4</strong><span style="line-height: 1.4285715;"> Set the inInterceptors to the CxfRs endpoint.</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>inInterceptors=#MyInterceptors</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em style="line-height: 1.4285715;">None</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>outInterceptors</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong style="line-height: 1.4285715;">Since Camel 2.12.4</strong><span style="line-height: 1.4285715;"> Set the outInterceptor to the CxfRs endpoint.</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code><span style="line-height: 1.4285715;">outInterceptors=#MyInterceptors</span></code></p></td><td colspan="1" rowspan="1" class
="confluenceTd"><p><span style="line-height: 1.4285715;">No</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em style="line-height: 1.4285715;">None</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code><span>inFaultInterceptors</span></code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong style="line-height: 1.4285715;">Since Camel 2.12.4</strong><span style="line-height: 1.4285715;"> Set the inFaultInterceptors to the CxfRs endpoint.</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code><span style="line-height: 1.4285715;">inFaultInterceptors=#MyInterceptors</span></code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><span style="line-height: 1.4285715;">No</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em style="line-height: 1.4285715;">None</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>outFaultIntercetpros</code></p></td><td co
lspan="1" rowspan="1" class="confluenceTd"><p><strong style="line-height: 1.4285715;">Since Camel 2.12.4</strong><span style="line-height: 1.4285715;"> Set the outFaultInterceptors to the CxfRs endpoint.</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code><span style="line-height: 1.4285715;">outFaultInterceptors=#MyInterceptors</span></code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><span style="line-height: 1.4285715;">No</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em style="line-height: 1.4285715;">None</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>continuationTimeout</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><span style="line-height: 1.4285715;"><strong>Since</strong> </span><strong style="line-height: 1.4285715;">Camel 2.14.0 </strong><span style="line-height: 1.4285715;">This option is used to set the CXF continuation timeout which could be used i
n CxfConsumer by default when the CXF server is using Jetty or Servlet transport. (Before </span><strong style="line-height: 1.4285715;">Camel 2.14.0</strong><span style="line-height: 1.4285715;">, CxfConsumer just set the continuation timeout to be 0, which means the continuation suspend operation never timeout.)</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code><span style="line-height: 1.4285715;">continuationTimeout=800000</span></code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em style="line-height: 1.4285715;">30000</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>ignoreDeleteMethodMessageBody</code></td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Since Camel 2.14.1</strong> This option is used to tell CxfRsProducer to ignore the message body of the DELETE method when using HTTP API.</td><td colspan="1" rowspan="1" class="conflu
enceTd"><code><span>ignoreDeleteMethodMessageBody=true</span></code></td><td colspan="1" rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" class="confluenceTd"><em>false</em></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>modelRef</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Since Camel 2.14.2</strong> This option is used to specify the <a shape="rect" href="http://cxf.apache.org/docs/jax-rs-advanced-features.html#JAX-RSAdvancedFeatures-RESTfulserviceswithoutannotations">model file</a> which is useful for the resource class without annotation.</p><p><strong>Since Camel 2.15</strong> This option can point to a model file without specifying a service class for emulating document-only endpoints</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>modelRef=</code><a shape="rect" class="external-link" href="http://classpath/org/apache/camel/component/cxf/jaxrs/CustomerServiceModel.xml" rel="nofollow" sty
le="font-family: monospace;line-height: 1.4285715;">classpath:/CustomerServiceModel.xml</a></p></td><td colspan="1" rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" class="confluenceTd"><em>None</em></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p class="p1"><code>performInvocation</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Since Camel 2.15</strong> When the option is true, camel will perform the invocation of the resource class instance and put the response object into the exchange for further processing.</td><td colspan="1" rowspan="1" class="confluenceTd"><p class="p1"><code>performInvocation= true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" class="confluenceTd"><em>false</em></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>propagateContexts</code></td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Since Camel 2.15</strong> When the
option is true, JAXRS <a shape="rect" class="external-link" href="https://jax-rs-spec.java.net/nonav/2.0-rev-a/apidocs/javax/ws/rs/core/UriInfo.html" rel="nofollow">UriInfo</a>, <a shape="rect" class="external-link" href="https://jax-rs-spec.java.net/nonav/2.0-rev-a/apidocs/javax/ws/rs/core/HttpHeaders.html" rel="nofollow">HttpHeaders</a>, <a shape="rect" class="external-link" href="https://jax-rs-spec.java.net/nonav/2.0-rev-a/apidocs/javax/ws/rs/core/Request.html" rel="nofollow">Request</a> and <a shape="rect" class="external-link" href="https://jax-rs-spec.java.net/nonav/2.0-rev-a/apidocs/javax/ws/rs/core/SecurityContext.html" rel="nofollow">SecurityContext</a> contexts will be available to custom CXFRS processors as typed Camel exchange properties. These contexts can be used to analyze the current requests using JAX-RS API.</td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class
="confluenceTd"> </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>loggingFeatureEnabled</code></td><td colspan="1" rowspan="1" class="confluenceTd">This option enables CXF Logging Feature which writes inbound and outbound REST messages to log.</td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" class="confluenceTd"><em>false</em></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>skipFaultLogging</code></td><td colspan="1" rowspan="1" class="confluenceTd">This option controls whether the <code>PhaseInterceptorChain</code> skips logging the Fault that it catches.</td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" class="confluenceTd"><em>false</em></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>loggingSizeLimit</code></td><td colspa
n="1" rowspan="1" class="confluenceTd">To limit the total size of number of bytes the logger will output when logging feature has been enabled.</td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" class="confluenceTd"><code>0</code></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>cookieHandler</code></td><td colspan="1" rowspan="1" class="confluenceTd">Since <strong>Camel 2.19.0</strong> Configure a cookie handler to maintain a HTTP session</td><td colspan="1" rowspan="1" class="confluenceTd"><code>cookieHandler=#exchangeCookieHandler</code></td><td colspan="1" rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" class="confluenceTd"><em>None</em></td></tr></tbody></table></div><p>You can also configure the CXF REST endpoint through the spring configuration. Since there are lots of difference between the CXF REST client and CXF REST Server, we provide dif
ferent configuration for them.<br clear="none"> Please check out the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-cxf/src/main/resources/schema/cxfEndpoint.xsd">schema file</a> and <a shape="rect" class="external-link" href="https://cwiki.apache.org/CXF20DOC/JAX-RS">CXF JAX-RS documentation</a> for more information.</p><h3 id="CXFRS-HowtoconfiguretheRESTendpointinCamel">How to configure the REST endpoint in Camel</h3><p>In <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-cxf/src/main/resources/schema/cxfEndpoint.xsd">camel-cxf schema file</a>, there are two elements for the REST endpoint definition. <strong>cxf:rsServer</strong> for REST consumer, <strong>cxf:rsClient</strong> for REST producer.<br clear="none"> You can find a Camel REST service route configuration example here.<plain-text-body>{snippet:id=cxfRsExample|lang=xml|url=camel/trunk/components/camel-cxf/src/
test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml}</plain-text-body></p><h3 id="CXFRS-HowtooverridetheCXFproduceraddressfrommessageheader">How to override the CXF producer address from message header</h3><p>The <code>camel-cxfrs</code> producer supports to override the services address by setting the message with the key of "<span>CamelDestinationOverrideUrl".</span></p><plain-text-body> // set up the service address from the message header to override the setting of CXF endpoint
+</plain-text-body><h3 id="CXFRS-Options">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>Description</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Example</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Required?</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>default value</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>resourceClasses</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The resource classes which you want to export as REST service. Multiple classes can be separated by comma.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>resourceClasses=org.apache.camel.rs.Example1,</code><br clear="none"> <code>org.apache.camel.rs.Exchange2</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspa
n="1" class="confluenceTd"><p><em>None</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>resourceClass</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Deprecated</strong>: Use <code>resourceClasses</code> The resource class which you want to export as REST service.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>resourceClass =org.apache.camel.rs.Example1</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>None</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>httpClientAPI</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>new to Camel 2.1</strong> If it is true, the CxfRsProducer will use the HttpClientAPI to invoke the service <br clear="none" class="atl-forced-newline"> If it is false, the CxfRsProducer will use the ProxyClientAPI to invoke the service</p></td><td colspan
="1" rowspan="1" class="confluenceTd"><p>httpClientAPI=true</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>true</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>synchronous</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>This option will let you decide to use sync or async API to do the underlying work. The default value is false which means it will try to use async API by default.</p><p>This option is available as of <strong>2.5</strong> for CxfRsConsumer and as of <strong>2.19</strong> for CxfRsProducer.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>synchronous=true</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>false</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>throwExceptionOnFailure</code></p></td><td colspan="1" rowspan="1" class="
confluenceTd"><p>New in 2.6, this option tells the CxfRsProducer to inspect return codes and will generate an Exception if the return code is larger than 207.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>throwExceptionOnFailure=true</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>true</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>maxClientCacheSize</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>New in 2.6, you can set a IN message header CamelDestinationOverrideUrl to dynamically override the target destination Web Service or REST Service defined in your routes.  The implementation caches CXF clients or ClientFactoryBean in CxfProvider and CxfRsProvider.  This option allows you to configure the maximum size of the cache.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>maxClientCacheSize=5</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>10</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>setDefaultBus</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>New in 2.9.0. <strong>deprecated</strong> use defaultBus option from Camel 2.16 onwards. Will set the default bus when CXF endpoint create a bus by itself</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>setDefaultBus=true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>false</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>defaultBus</code></td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.16:</strong> <span>Will set the default bus when CXF endpoint create a bus by itself</span></td><td colspan="1" rowspan="1" class="confluenceTd"><code>defaultBus=true</code></td><td colspan="1" rowspan="1" c
lass="confluenceTd">No</td><td colspan="1" rowspan="1" class="confluenceTd"><em>false</em></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>bus</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>New in 2.9.0. A default bus created by CXF Bus Factory. Use <code>#</code> notation to reference a bus object from the registry. The referenced object must be an instance of <code>org.apache.cxf.Bus</code>.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>bus=#busName</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>None</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>bindingStyle</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>As of 2.11</strong>. Sets how requests and responses will be mapped to/from Camel. Two values are possible:</p><ul class="alternate"><li><code>SimpleConsumer</code> =>
see the <a shape="rect" href="#CXFRS-ConsumingaRESTRequest-SimpleBindingStyle">Consuming a REST Request with the Simple Binding Style</a> below.</li><li><code>Default</code> => the default style. For consumers this passes on a <code>MessageContentsList</code> to the route, requiring low-level processing in the route.</li><li><span style="font-family: monospace;">Custom</span> => allows you to specify a custom binding through the <code>binding</code> option.</li></ul></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>bindingStyle=SimpleConsumer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>Default</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code><span>binding</span></code></p></td><td colspan="1" rowspan="1" class="confluenceTd">Allows you to specify a custom <code>CxfRsBinding</code> implementation to perform low-level processing of the raw CXF req
uest and response objects. The implementation must be bound in the Camel registry, and you must use the hash (#) notation to refer to it.</td><td colspan="1" rowspan="1" class="confluenceTd"><code><span>binding=#myBinding</span></code></td><td colspan="1" rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" class="confluenceTd"><code>DefaultCxfRsBinding</code></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code><span style="line-height: 1.4285715;">providers</span></code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong style="line-height: 1.4285715;">Since Camel 2.12.2</strong><span style="line-height: 1.4285715;"> set custom JAX-RS providers list to the CxfRs endpoint.</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>providers=#MyProviders</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em style="line-height: 1.4285715;">No
ne</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code><span style="line-height: 1.4285715;">schemaLocations</span></code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong style="line-height: 1.4285715;">Since Camel 2.12.2</strong><span style="line-height: 1.4285715;"> Sets the locations of the schemas which can be used to validate the incoming XML or JAXB-driven JSON.</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>schemaLocations=#MySchemaLocations</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em style="line-height: 1.4285715;">None</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code><span style="line-height: 1.4285715;">features</span></code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong style="line-height: 1.4285715;">Since Camel 2.12.3</strong><span style="line-height: 1.428
5715;"> Set the feature list to the CxfRs endpoint.</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>features=#MyFeatures</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em style="line-height: 1.4285715;">None</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>properties</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong style="line-height: 1.4285715;">Since Camel 2.12.4</strong><span style="line-height: 1.4285715;"> Set the properties to the CxfRs endpoint.</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>properties=#MyProperties</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em style="line-height: 1.4285715;">None</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>inInterceptors</code></p>
</td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong style="line-height: 1.4285715;">Since Camel 2.12.4</strong><span style="line-height: 1.4285715;"> Set the inInterceptors to the CxfRs endpoint.</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>inInterceptors=#MyInterceptors</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em style="line-height: 1.4285715;">None</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>outInterceptors</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong style="line-height: 1.4285715;">Since Camel 2.12.4</strong><span style="line-height: 1.4285715;"> Set the outInterceptor to the CxfRs endpoint.</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code><span style="line-height: 1.4285715;">outInterceptors=#MyInterceptors</span></code></p></td><td colspan="1" rowspan="1" class
="confluenceTd"><p><span style="line-height: 1.4285715;">No</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em style="line-height: 1.4285715;">None</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code><span>inFaultInterceptors</span></code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong style="line-height: 1.4285715;">Since Camel 2.12.4</strong><span style="line-height: 1.4285715;"> Set the inFaultInterceptors to the CxfRs endpoint.</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code><span style="line-height: 1.4285715;">inFaultInterceptors=#MyInterceptors</span></code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><span style="line-height: 1.4285715;">No</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em style="line-height: 1.4285715;">None</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>outFaultIntercetpros</code></p></td><td co
lspan="1" rowspan="1" class="confluenceTd"><p><strong style="line-height: 1.4285715;">Since Camel 2.12.4</strong><span style="line-height: 1.4285715;"> Set the outFaultInterceptors to the CxfRs endpoint.</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code><span style="line-height: 1.4285715;">outFaultInterceptors=#MyInterceptors</span></code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><span style="line-height: 1.4285715;">No</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em style="line-height: 1.4285715;">None</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>continuationTimeout</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><span style="line-height: 1.4285715;"><strong>Since</strong> </span><strong style="line-height: 1.4285715;">Camel 2.14.0 </strong><span style="line-height: 1.4285715;">This option is used to set the CXF continuation timeout which could be used i
n CxfConsumer by default when the CXF server is using Jetty or Servlet transport. (Before </span><strong style="line-height: 1.4285715;">Camel 2.14.0</strong><span style="line-height: 1.4285715;">, CxfConsumer just set the continuation timeout to be 0, which means the continuation suspend operation never timeout.)</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code><span style="line-height: 1.4285715;">continuationTimeout=800000</span></code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em style="line-height: 1.4285715;">30000</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>ignoreDeleteMethodMessageBody</code></td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Since Camel 2.14.1</strong> This option is used to tell CxfRsProducer to ignore the message body of the DELETE method when using HTTP API.</td><td colspan="1" rowspan="1" class="conflu
enceTd"><code><span>ignoreDeleteMethodMessageBody=true</span></code></td><td colspan="1" rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" class="confluenceTd"><em>false</em></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>modelRef</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Since Camel 2.14.2</strong> This option is used to specify the <a shape="rect" href="http://cxf.apache.org/docs/jax-rs-advanced-features.html#JAX-RSAdvancedFeatures-RESTfulserviceswithoutannotations">model file</a> which is useful for the resource class without annotation.</p><p><strong>Since Camel 2.15</strong> This option can point to a model file without specifying a service class for emulating document-only endpoints</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>modelRef=</code><a shape="rect" class="external-link" href="http://classpath/org/apache/camel/component/cxf/jaxrs/CustomerServiceModel.xml" style="font-family
: monospace;line-height: 1.4285715;" rel="nofollow">classpath:/CustomerServiceModel.xml</a></p></td><td colspan="1" rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" class="confluenceTd"><em>None</em></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p class="p1"><code>performInvocation</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Since Camel 2.15</strong> When the option is true, camel will perform the invocation of the resource class instance and put the response object into the exchange for further processing.</td><td colspan="1" rowspan="1" class="confluenceTd"><p class="p1"><code>performInvocation= true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" class="confluenceTd"><em>false</em></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>propagateContexts</code></td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Since Camel 2.15</strong> When the
option is true, JAXRS <a shape="rect" class="external-link" href="https://jax-rs-spec.java.net/nonav/2.0-rev-a/apidocs/javax/ws/rs/core/UriInfo.html" rel="nofollow">UriInfo</a>, <a shape="rect" class="external-link" href="https://jax-rs-spec.java.net/nonav/2.0-rev-a/apidocs/javax/ws/rs/core/HttpHeaders.html" rel="nofollow">HttpHeaders</a>, <a shape="rect" class="external-link" href="https://jax-rs-spec.java.net/nonav/2.0-rev-a/apidocs/javax/ws/rs/core/Request.html" rel="nofollow">Request</a> and <a shape="rect" class="external-link" href="https://jax-rs-spec.java.net/nonav/2.0-rev-a/apidocs/javax/ws/rs/core/SecurityContext.html" rel="nofollow">SecurityContext</a> contexts will be available to custom CXFRS processors as typed Camel exchange properties. These contexts can be used to analyze the current requests using JAX-RS API.</td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class
="confluenceTd"> </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>loggingFeatureEnabled</code></td><td colspan="1" rowspan="1" class="confluenceTd">This option enables CXF Logging Feature which writes inbound and outbound REST messages to log.</td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" class="confluenceTd"><em>false</em></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>skipFaultLogging</code></td><td colspan="1" rowspan="1" class="confluenceTd">This option controls whether the <code>PhaseInterceptorChain</code> skips logging the Fault that it catches.</td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" class="confluenceTd"><em>false</em></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>loggingSizeLimit</code></td><td colspa
n="1" rowspan="1" class="confluenceTd">To limit the total size of number of bytes the logger will output when logging feature has been enabled.</td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" class="confluenceTd"><code>0</code></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>cookieHandler</code></td><td colspan="1" rowspan="1" class="confluenceTd">Since <strong>Camel 2.19.0</strong> Configure a cookie handler to maintain a HTTP session</td><td colspan="1" rowspan="1" class="confluenceTd"><code>cookieHandler=#exchangeCookieHandler</code></td><td colspan="1" rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" class="confluenceTd"><em>None</em></td></tr></tbody></table></div><p>You can also configure the CXF REST endpoint through the spring configuration. Since there are lots of difference between the CXF REST client and CXF REST Server, we provide dif
ferent configuration for them.<br clear="none"> Please check out the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-cxf/src/main/resources/schema/cxfEndpoint.xsd">schema file</a> and <a shape="rect" class="external-link" href="https://cwiki.apache.org/CXF20DOC/JAX-RS">CXF JAX-RS documentation</a> for more information.</p><h3 id="CXFRS-HowtoconfiguretheRESTendpointinCamel">How to configure the REST endpoint in Camel</h3><p>In <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-cxf/src/main/resources/schema/cxfEndpoint.xsd">camel-cxf schema file</a>, there are two elements for the REST endpoint definition. <strong>cxf:rsServer</strong> for REST consumer, <strong>cxf:rsClient</strong> for REST producer.<br clear="none"> You can find a Camel REST service route configuration example here.<plain-text-body>{snippet:id=cxfRsExample|lang=xml|url=camel/trunk/components/camel-cxf/src/
test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml}</plain-text-body></p><h3 id="CXFRS-HowtooverridetheCXFproduceraddressfrommessageheader">How to override the CXF producer address from message header</h3><p>The <code>camel-cxfrs</code> producer supports to override the services address by setting the message with the key of "<span>CamelDestinationOverrideUrl".</span></p><plain-text-body> // set up the service address from the message header to override the setting of CXF endpoint
exchange.getIn().setHeader(Exchange.DESTINATION_OVERRIDE_URL, constant(getServiceAddress()));
</plain-text-body><h3 id="CXFRS-ConsumingaRESTRequest-SimpleBindingStyle">Consuming a REST Request - Simple Binding Style</h3><p><strong>Available as of Camel 2.11</strong></p><p>The <code>Default</code> binding style is rather low-level, requiring the user to manually process the <code>MessageContentsList</code> object coming into the route. Thus, it tightly couples the route logic with the method signature and parameter indices of the JAX-RS operation. Somewhat inelegant, difficult and error-prone.</p><p>In contrast, the <code>SimpleConsumer</code> binding style performs the following mappings, in order to <strong>make the request data more accessible</strong> to you within the Camel Message:</p><ul><li>JAX-RS Parameters (@HeaderParam, @QueryParam, etc.) are injected as IN message headers. The header name matches the value of the annotation.</li><li>The request entity (POJO or other type) becomes the IN message body. If a single entity cannot be identified in the JAX-RS method sig
nature, it falls back to the original <code>MessageContentsList</code>.</li><li>Binary <code>@Multipart</code> body parts become IN message attachments, supporting <code>DataHandler</code>, <code>InputStream</code>, <code>DataSource</code> and CXF's <code>Attachment</code> class.</li><li>Non-binary <code>@Multipart</code> body parts are mapped as IN message headers. The header name matches the Body Part name.</li></ul><p>Additionally, the following rules apply to the <strong>Response mapping</strong>:</p><ul><li>If the message body type is different to <code>javax.ws.rs.core.Response</code> (user-built response), a new <code>Response</code> is created and the message body is set as the entity (so long it's not null). The response status code is taken from the <code>Exchange.HTTP_RESPONSE_CODE</code> header, or defaults to 200 OK if not present.</li><li>If the message body type is equal to <code>javax.ws.rs.core.Response</code>, it means that the user has built a custom response, and
therefore it is respected and it becomes the final response.</li><li>In all cases, Camel headers permitted by custom or default <code>HeaderFilterStrategy</code> are added to the HTTP response.</li></ul><h4 id="CXFRS-EnablingtheSimpleBindingStyle">Enabling the Simple Binding Style</h4><p>This binding style can be activated by setting the <code>bindingStyle</code> parameter in the consumer endpoint to value <code>SimpleConsumer</code>:</p><parameter ac:name="language">java</parameter><plain-text-body> from("cxfrs:bean:rsServer?bindingStyle=SimpleConsumer")
.to("log:TEST?showAll=true");
Modified: websites/production/camel/content/dataset.html
==============================================================================
--- websites/production/camel/content/dataset.html (original)
+++ websites/production/camel/content/dataset.html Sun Mar 31 15:23:07 2019
@@ -88,18 +88,18 @@
<tbody>
<tr>
<td valign="top" width="100%">
-<div class="wiki-content maincontent"><h2 id="DataSet-DataSetComponent">DataSet Component</h2><p></p><div class="conf-macro output-block" data-hasbody="false" data-macro-name="include"><a shape="rect" href="testing.html">Testing</a> of distributed and asynchronous processing is notoriously difficult. The <a shape="rect" href="mock.html">Mock</a>, <a shape="rect" href="test.html">Test</a> and <a shape="rect" href="dataset.html">DataSet</a> endpoints work great with the <a shape="rect" href="testing.html">Camel Testing Framework</a> to simplify your unit and integration testing using <a shape="rect" href="enterprise-integration-patterns.html">Enterprise Integration Patterns</a> and Camel's large range of <a shape="rect" href="components.html">Components</a> together with the powerful <a shape="rect" href="bean-integration.html">Bean Integration</a>.</div><p>The DataSet component provides a mechanism to easily perform load & soak testing of your system. It works by allowing you to
create <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/component/dataset/DataSet.html">DataSet instances</a> both as a source of messages and as a way to assert that the data set is received.</p><p>Camel will use the <a shape="rect" href="log.html">throughput logger</a> when sending dataset's.</p><h3 id="DataSet-URIformat">URI format</h3><div class="code panel pdl conf-macro output-block" data-hasbody="true" data-macro-name="code" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<div class="wiki-content maincontent"><h2 id="DataSet-DataSetComponent">DataSet Component</h2><p></p><div class="conf-macro output-block" data-hasbody="false" data-macro-name="include"><a shape="rect" href="testing.html">Testing</a> of distributed and asynchronous processing is notoriously difficult. The <a shape="rect" href="mock.html">Mock</a>, <a shape="rect" href="test.html">Test</a> and <a shape="rect" href="dataset.html">DataSet</a> endpoints work great with the <a shape="rect" href="testing.html">Camel Testing Framework</a> to simplify your unit and integration testing using <a shape="rect" href="enterprise-integration-patterns.html">Enterprise Integration Patterns</a> and Camel's large range of <a shape="rect" href="components.html">Components</a> together with the powerful <a shape="rect" href="bean-integration.html">Bean Integration</a>.</div><p>The DataSet component provides a mechanism to easily perform load & soak testing of your system. It works by allowing you to
create <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/component/dataset/DataSet.html">DataSet instances</a> both as a source of messages and as a way to assert that the data set is received.</p><p>Camel will use the <a shape="rect" href="log.html">throughput logger</a> when sending dataset's.</p><h3 id="DataSet-URIformat">URI format</h3><div class="code panel pdl conf-macro output-block" style="border-width: 1px;" data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java; gutter: false; theme: Default" data-theme="Default">dataset:name[?options]
</pre>
</div></div><p>Where <strong><code>name</code></strong> is used to find the <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/component/dataset/DataSet.html">DataSet instance</a> in the <a shape="rect" href="registry.html">Registry</a></p><p>Camel ships with a support implementation of <strong><code>org.apache.camel.component.dataset.DataSet</code></strong>, the <strong><code>org.apache.camel.component.dataset.DataSetSupport</code></strong> class, that can be used as a base for implementing your own <strong><code>DataSet</code></strong>.</p><p>Camel also ships with some implementations that can be used for testing:  </p><ul><li><strong><code>org.apache.camel.component.dataset.SimpleDataSet</code></strong></li><li><strong><code>org.apache.camel.component.dataset.ListDataSet</code></strong><span> <br clear="none"></span></li><li><strong><code>org.apache.camel.component.dataset.FileDataSet</code></strong><span><sp
an><br clear="none"></span></span></li></ul><p><span><span>all of which extend <strong><code>DataSetSupport</code></strong>.</span></span></p><h3 id="DataSet-Options">Options</h3><div class="confluenceTableSmall conf-macro output-block" data-hasbody="true" data-macro-name="div"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Option</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>produceDelay</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>3</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Allows a delay in ms to be specified, which causes producers to pause in order to simulate slow producers.</p><p>Uses a minimum of <strong><code>3ms</code></strong> delay. Set to <strong><code>-1</code></strong> t
o force no delay at all.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumeDelay</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>0</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Allows a delay in ms to be specified, which causes consumers to pause in order to simulate slow consumers.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>preloadSize</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>0</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Sets how many messages should be pre-loaded (sent) before the route completes its initialization.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>initialDelay</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>1000</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.1:</strong> Time period in milliseconds to wait before star
ting sending messages.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>minRate</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>0</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Wait until the <strong><code>DataSet</code></strong> contains at least this number of messages.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>dataSetIndex</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>lenient</code></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.17:</strong> Controls the behavior of the <strong><code>CamelDataSetIndex</code></strong> header.</p><p>The supported values are:</p><ul><li><strong><code>strict</code></strong></li><li><strong><code>lenient</code></strong></li><li><strong><code>off</code></strong></li></ul><p>The default behavior prior to <strong>Camel 2.17</strong> can be restored using <strong><code>dataSetIndex=strict</code></stron
g>.</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh">Client Type</th><th colspan="1" rowspan="1" class="confluenceTh"><code>dataSetIndex</code> Value</th><th colspan="1" rowspan="1" class="confluenceTh"><strong><code>CamelDataSetIndex</code></strong> Header Behavior</th></tr><tr><td colspan="1" rowspan="3" class="confluenceTd">Consumer<br clear="none"><br clear="none"></td><td colspan="1" rowspan="1" class="confluenceTd"><code>strict</code></td><td colspan="1" rowspan="2" class="confluenceTd" style="text-align: left;">The header will always be set.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>lenient</code></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>off</code></td><td colspan="1" rowspan="1" class="confluenceTd">The header will NOT be set.</td></tr><tr><td colspan="1" rowspan="3" class="confluenceTd">Producer<br clear="none"><br clear="none"></td><td colspan="1"
rowspan="1" class="confluenceTd"><code>strict</code></td><td colspan="1" rowspan="1" class="confluenceTd">The header must be present and the value of the header will be verified.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>lenient</code></td><td colspan="1" rowspan="1" class="confluenceTd">If the header is present, the value of the header will be verified. If the header is not present, it will be set.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>off</code></td><td colspan="1" rowspan="1" class="confluenceTd">If the header is present, the value of the header will not be verified. If the header is not present, it will not be set.</td></tr></tbody></table></div></td></tr></tbody></table></div></div>
-<p>You can append query options to the URI in the following format: <strong><code>?option=value&option=value&...</code></strong></p><h3 id="DataSet-ConfiguringDataSet">Configuring DataSet</h3><p>Camel will lookup in the <a shape="rect" href="registry.html">Registry</a> for a bean implementing the <strong><code>DataSet</code></strong> interface. So you can register your own <strong><code>DataSet</code></strong> as:</p><div class="code panel pdl conf-macro output-block" data-hasbody="true" data-macro-name="code" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<p>You can append query options to the URI in the following format: <strong><code>?option=value&option=value&...</code></strong></p><h3 id="DataSet-ConfiguringDataSet">Configuring DataSet</h3><p>Camel will lookup in the <a shape="rect" href="registry.html">Registry</a> for a bean implementing the <strong><code>DataSet</code></strong> interface. So you can register your own <strong><code>DataSet</code></strong> as:</p><div class="code panel pdl conf-macro output-block" style="border-width: 1px;" data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java; gutter: false; theme: Default" data-theme="Default"><bean id="myDataSet" class="com.mycompany.MyDataSet">
<property name="size" value="100"/>
</bean>
</pre>
-</div></div><h3 id="DataSet-Example">Example</h3><p>For example, to test that a set of messages are sent to a queue and then consumed from the queue without losing any messages:</p><div class="code panel pdl conf-macro output-block" data-hasbody="true" data-macro-name="code" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="DataSet-Example">Example</h3><p>For example, to test that a set of messages are sent to a queue and then consumed from the queue without losing any messages:</p><div class="code panel pdl conf-macro output-block" style="border-width: 1px;" data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java; gutter: false; theme: Default" data-theme="Default">// Send the dataset to a queue
from("dataset:foo")
.to("activemq:SomeQueue");