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 2016/04/01 12:19:47 UTC

svn commit: r984400 - in /websites/production/camel/content: book-component-appendix.html book-in-one-page.html cache/main.pageCache jpa.html

Author: buildbot
Date: Fri Apr  1 10:19:47 2016
New Revision: 984400

Log:
Production update by buildbot for camel

Modified:
    websites/production/camel/content/book-component-appendix.html
    websites/production/camel/content/book-in-one-page.html
    websites/production/camel/content/cache/main.pageCache
    websites/production/camel/content/jpa.html

Modified: websites/production/camel/content/book-component-appendix.html
==============================================================================
--- websites/production/camel/content/book-component-appendix.html (original)
+++ websites/production/camel/content/book-component-appendix.html Fri Apr  1 10:19:47 2016
@@ -1016,11 +1016,11 @@ template.send("direct:alias-verify&
 ]]></script>
 </div></div><p></p><h3 id="BookComponentAppendix-SeeAlso.8">See Also</h3>
 <ul><li><a shape="rect" href="configuring-camel.html">Configuring Camel</a></li><li><a shape="rect" href="component.html">Component</a></li><li><a shape="rect" href="endpoint.html">Endpoint</a></li><li><a shape="rect" href="getting-started.html">Getting Started</a></li></ul><ul><li><a shape="rect" href="crypto.html">Crypto</a> Crypto is also available as a <a shape="rect" href="data-format.html">Data Format</a></li></ul> <h2 id="BookComponentAppendix-CXFComponent">CXF Component</h2><div class="confluence-information-macro confluence-information-macro-note"><span class="aui-icon aui-icon-small aui-iconfont-warning confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>When using CXF as a consumer, the <a shape="rect" href="cxf-bean-component.html">CXF Bean Component</a> allows you to factor out how message payloads are received from their processing as a RESTful or SOAP web service. This has the potential of using a multitude of transports to cons
 ume web services. The bean component's configuration is also simpler and provides the fastest method to implement web services using Camel and CXF.</p></div></div><div class="confluence-information-macro confluence-information-macro-tip"><span class="aui-icon aui-icon-small aui-iconfont-approve confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>When using CXF in streaming modes (see DataFormat option), then also read about <a shape="rect" href="stream-caching.html">Stream caching</a>.</p></div></div><p>The <strong>cxf:</strong> component provides integration with <a shape="rect" href="http://cxf.apache.org">Apache CXF</a> for connecting to JAX-WS services hosted in CXF.</p><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1459498674472 {padding: 0px;}
-div.rbtoc1459498674472 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1459498674472 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1459505868359 {padding: 0px;}
+div.rbtoc1459505868359 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1459505868359 li {margin-left: 0px;padding-left: 0px;}
 
-/*]]>*/</style></p><div class="toc-macro rbtoc1459498674472">
+/*]]>*/</style></p><div class="toc-macro rbtoc1459505868359">
 <ul class="toc-indentation"><li><a shape="rect" href="#BookComponentAppendix-CXFComponent">CXF Component</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#BookComponentAppendix-URIformat">URI format</a></li><li><a shape="rect" href="#BookComponentAppendix-Options">Options</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#BookComponentAppendix-Thedescriptionsofthedataformats">The descriptions of the dataformats</a>
@@ -5660,7 +5660,7 @@ monitor.start();
     &lt;!-- use the same version as your Camel core version --&gt;
 &lt;/dependency&gt;
 ]]></script>
-</div></div><h3 id="BookComponentAppendix-Sendingtotheendpoint.2">Sending to the endpoint</h3><p>You can store a Java entity bean in a database by sending it to a JPA producer endpoint. The body of the <em>In</em> message is assumed to be an entity bean (that is, a POJO with an <a shape="rect" class="external-link" href="http://java.sun.com/javaee/5/docs/api/javax/persistence/Entity.html" rel="nofollow">@Entity</a> annotation on it) or a collection or array of entity beans.</p><p>If the body is a List of entities, make sure to use <strong>entityType=java.util.ArrayList</strong> as a configuration passed to the producer endpoint.</p><p>If the body does not contain one of the previous listed types, put a <a shape="rect" href="message-translator.html">Message Translator</a> in front of the endpoint to perform the necessary conversion first.</p><h3 id="BookComponentAppendix-Consumingfromtheendpoint.2">Consuming from the endpoint</h3><p>Consuming messages from a JPA consumer endpoint rem
 oves (or updates) entity beans in the database. This allows you to use a database table as a logical queue: consumers take messages from the queue and then delete/update them to logically remove them from the queue.</p><p>If you do not wish to delete the entity bean when it has been processed (and when routing is done), you can specify <code>consumeDelete=false</code> on the URI. This will result in the entity being processed each poll.</p><p>If you would rather perform some update on the entity to mark it as processed (such as to exclude it from a future query) then you can annotate a method with <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-jpa/apidocs/org/apache/camel/component/jpa/Consumed.html">@Consumed</a> which will be invoked on your entity bean when the entity bean when it has been processed (and when routing is done).</p><p>From <strong>Camel 2.13</strong> onwards you can use <a shape="rect" class="external-link" href="http://came
 l.apache.org/maven/current/camel-jpa/apidocs/org/apache/camel/component/jpa/PreConsumed.html">@PreConsumed</a> which will be invoked on your entity bean before it has been processed (before routing).</p><h3 id="BookComponentAppendix-URIformat.35">URI format</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="BookComponentAppendix-Sendingtotheendpoint.2">Sending to the endpoint</h3><p>You can store a Java entity bean in a database by sending it to a JPA producer endpoint. The body of the <em>In</em> message is assumed to be an entity bean (that is, a POJO with an <a shape="rect" class="external-link" href="http://java.sun.com/javaee/5/docs/api/javax/persistence/Entity.html" rel="nofollow">@Entity</a> annotation on it) or a collection or array of entity beans.</p><p>If the body is a List of entities, make sure to use <strong>entityType=java.util.ArrayList</strong> as a configuration passed to the producer endpoint.</p><p>If the body does not contain one of the previous listed types, put a <a shape="rect" href="message-translator.html">Message Translator</a> in front of the endpoint to perform the necessary conversion first.</p><h3 id="BookComponentAppendix-Consumingfromtheendpoint.2">Consuming from the endpoint</h3><p>Consuming messages from a JPA consumer endpoint rem
 oves (or updates) entity beans in the database. This allows you to use a database table as a logical queue: consumers take messages from the queue and then delete/update them to logically remove them from the queue.</p><p>If you do not wish to delete the entity bean when it has been processed (and when routing is done), you can specify <code>consumeDelete=false</code> on the URI. This will result in the entity being processed each poll.</p><p>If you would rather perform some update on the entity to mark it as processed (such as to exclude it from a future query) then you can annotate a method with <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-jpa/apidocs/org/apache/camel/component/jpa/Consumed.html">@Consumed</a> which will be invoked on your entity bean when the entity bean when it has been processed (and when routing is done).</p><p>From <strong>Camel 2.13</strong> onwards you can use <a shape="rect" class="external-link" href="http://came
 l.apache.org/maven/current/camel-jpa/apidocs/org/apache/camel/component/jpa/PreConsumed.html">@PreConsumed</a> which will be invoked on your entity bean before it has been processed (before routing).</p><p>If you are consuming a lot (100K+) of rows and experience OutOfMemory problems you should set the maximumResults to sensible value.</p><h3 id="BookComponentAppendix-URIformat.35">URI format</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[jpa:entityClassName[?options]
 ]]></script>
 </div></div><p>For sending to the endpoint, the <em>entityClassName</em> is optional. If specified, it helps the <a shape="rect" href="type-converter.html">Type Converter</a> to ensure the body is of the correct type.</p><p>For consuming, the <em>entityClassName</em> is mandatory.</p><p>You can append query options to the URI in the following format, <code>?option=value&amp;option=value&amp;...</code></p><h3 id="BookComponentAppendix-Options.29">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>entityType</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>entityClassName</em></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Overrides the <em>entityClas
 sName</em> from the URI.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>persistenceUnit</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>camel</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The JPA persistence unit used by default.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumeDelete</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>JPA consumer only:</strong> If <code>true</code>, the entity is deleted after it is consumed; if <code>false</code>, the entity is not deleted.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumeLockEntity</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>JPA consumer only:</strong> Specifies whether or not to set a
 n exclusive lock on each entity bean while processing the results from polling.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>flushOnSend</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>JPA producer only:</strong> Flushes the <a shape="rect" class="external-link" href="http://java.sun.com/javaee/5/docs/api/javax/persistence/EntityManager.html" rel="nofollow">EntityManager</a> after the entity bean has been persisted.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>maximumResults</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>JPA consumer only:</strong> Set the maximum number of results to retrieve on the <a shape="rect" class="external-link" href="http://java.sun.com/javaee/5/docs/api/javax/persistence/Query.html" rel="nof
 ollow">Query</a>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>transactionManager</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>This option is <a shape="rect" href="registry.html">Registry</a> based which requires the <code>#</code> notation so that the given <code>transactionManager</code> being specified can be looked up properly, e.g. <code>transactionManager=#myTransactionManager</code>. It specifies the transaction manager to use. If none provided, Camel will use a <code>JpaTransactionManager</code> by default. Can be used to set a JTA transaction manager (for integration with an EJB container).</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.delay</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>500</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>JPA consumer only:
 </strong> Delay in milliseconds between each poll.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.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>JPA consumer only:</strong> Milliseconds before polling starts.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.useFixedDelay</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>JPA consumer only:</strong> Set to <code>true</code> to use fixed delay between polls, otherwise fixed rate is used. See <a shape="rect" class="external-link" href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ScheduledExecutorService.html" rel="nofollow">ScheduledExecutorService</a> in JDK for details.</p></td></tr><tr><td colspan="1" rowspan="1" class="conflue
 nceTd"><p><code>maxMessagesPerPoll</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>0</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>JPA consumer only:</strong> An integer value to define the maximum number of messages to gather per poll. By default, no maximum is set. Can be used to avoid polling many thousands of messages when starting up the server. Set a value of 0 or negative to disable.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.query</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>JPA consumer only:</strong> To use a custom query when consuming data.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.namedQuery</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>JPA consu
 mer only:</strong> To use a named query when consuming data.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.nativeQuery</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>JPA consumer only:</strong> To use a custom native query when consuming data. You may want to use the option <code>consumer.resultClass</code> also when using native queries.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.parameters</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12: JPA consumer only:</strong> This option is <a shape="rect" href="registry.html">Registry</a> based which requires the <code>#</code> notation. This key/value mapping is used for building the query parameters. It's is expected to be of the generic type <code>java.util.Map&lt
 ;String, Object&gt;</code> where the keys are the named parameters of a given JPA query and the values are their corresponding effective values you want to select for.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.resultClass</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.7: JPA consumer only:</strong> Defines the type of the returned payload (we will call <code>entityManager.createNativeQuery(nativeQuery, resultClass)</code> instead of <code>entityManager.createNativeQuery(nativeQuery)</code>). Without this option, we will return an object array. Only has an affect when using in conjunction with native query when consuming data.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.transacted</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" c
 lass="confluenceTd"><p><strong>Camel 2.7.5/2.8.3/2.9: JPA consumer only:</strong> Whether to run the consumer in transacted mode, by which all messages will either commit or rollback, when the entire batch has been processed. The default behavior (false) is to commit all the previously successfully processed messages, and only rollback the last failed message.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.lockModeType</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>WRITE</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.11.2/2.12:</strong> To configure the lock mode on the consumer. The possible values is defined in the enum <code>javax.persistence.LockModeType</code>. The default value is changed to <code>PESSIMISTIC_WRITE</code> since <strong>Camel 2.13</strong>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.SkipLockedEntity</code></p></td><td colsp
 an="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.13:</strong> To configure whether to use NOWAIT on lock and silently skip the entity.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>usePersist</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.5: JPA producer only:</strong> Indicates to use <code>entityManager.persist(entity)</code> instead of <code>entityManager.merge(entity)</code>. Note: <code>entityManager.persist(entity)</code> doesn't work for detached entities (where the EntityManager has to execute an UPDATE instead of an INSERT query)!</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>joinTransaction</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.12.3:</strong> camel-jpa will join transaction by default from Camel 2.12 onwards. You can use this option to turn this off, for example if you use LOCAL_RESOURCE and join transaction doesn't work with your JPA provider. This option can also be set globally on the <code>JpaComponent</code>, instead of having to set it on all endpoints.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p class="p1">usePassedInEntityManager</p></td><td colspan="1" rowspan="1" class="confluenceTd">false</td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.12.4/2.13.1 JPA producer only:</strong> If set to true, then Camel will use the EntityManager from the header<p class="p1">JpaConstants.ENTITYMANAGER instead of the configured entity manager on the component/endpoint. This allows end users to control which entity manager will be in use.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">sharedEntityManager</td><td colspa
 n="1" rowspan="1" class="confluenceTd">false</td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.16:</strong>&#160;whether to use spring's SharedEntityManager for the consumer/producer. A good idea may be to set joinTransaction=false if this option is true, as sharing the entity manager and mixing transactions is not a good idea.</td></tr></tbody></table></div><h3 id="BookComponentAppendix-MessageHeaders.10">Message Headers</h3><p>Camel adds the following message headers to the exchange:</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Header</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>CamelJpaTemplate</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>JpaTemplate</code></p><
 /td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Not supported anymore since Camel 2.12:</strong> The <code>JpaTemplate</code> object that is used to access the entity bean. You need this object in some situations, for instance in a type converter or when you are doing some custom processing. See <a shape="rect" class="external-link" href="https://issues.apache.org/jira/browse/CAMEL-5932">CAMEL-5932</a> for the reason why the support for this header has been dropped.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelEntityManager</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>EntityManager</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12: JPA consumer / Camel 2.12.2: JPA producer:</strong> The JPA <code>EntityManager</code> object being used by <code>JpaConsumer</code> or <code>JpaProducer</code>.</p></td></tr></tbody></table></div></div><h3 id="BookComponentAppendix-Configuri
 ngEntityManagerFactory">Configuring EntityManagerFactory</h3><p>Its strongly advised to configure the JPA component to use a specific <code>EntityManagerFactory</code> instance. If failed to do so each <code>JpaEndpoint</code> will auto create their own instance of <code>EntityManagerFactory</code> which most often is not what you want.</p><p>For example, you can instantiate a JPA component that references the <code>myEMFactory</code> entity manager factory, as follows:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">

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 Apr  1 10:19:47 2016
@@ -3729,11 +3729,11 @@ The tutorial has been designed in two pa
 While not actual tutorials you might find working through the source of the various <a shape="rect" href="examples.html">Examples</a> useful.</li></ul>
 
 <h2 id="BookInOnePage-TutorialonSpringRemotingwithJMS">Tutorial on Spring Remoting with JMS</h2><p>&#160;</p><div class="confluence-information-macro confluence-information-macro-information"><p class="title">Thanks</p><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>This tutorial was kindly donated to Apache Camel by Martin Gilday.</p></div></div><h2 id="BookInOnePage-Preface">Preface</h2><p>This tutorial aims to guide the reader through the stages of creating a project which uses Camel to facilitate the routing of messages from a JMS queue to a <a shape="rect" class="external-link" href="http://www.springramework.org" rel="nofollow">Spring</a> service. The route works in a synchronous fashion returning a response to the client.</p><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1459498720926 {padding: 0px;}
-div.rbtoc1459498720926 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1459498720926 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1459505890191 {padding: 0px;}
+div.rbtoc1459505890191 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1459505890191 li {margin-left: 0px;padding-left: 0px;}
 
-/*]]>*/</style></p><div class="toc-macro rbtoc1459498720926">
+/*]]>*/</style></p><div class="toc-macro rbtoc1459505890191">
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-TutorialonSpringRemotingwithJMS">Tutorial on Spring Remoting with JMS</a></li><li><a shape="rect" href="#BookInOnePage-Preface">Preface</a></li><li><a shape="rect" href="#BookInOnePage-Prerequisites">Prerequisites</a></li><li><a shape="rect" href="#BookInOnePage-Distribution">Distribution</a></li><li><a shape="rect" href="#BookInOnePage-About">About</a></li><li><a shape="rect" href="#BookInOnePage-CreatetheCamelProject">Create the Camel Project</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-UpdatethePOMwithDependencies">Update the POM with Dependencies</a></li></ul>
 </li><li><a shape="rect" href="#BookInOnePage-WritingtheServer">Writing the Server</a>
@@ -5848,11 +5848,11 @@ So we completed the last piece in the pi
 <p>This example has been removed from <strong>Camel 2.9</strong> onwards. Apache Axis 1.4 is a very old and unsupported framework. We encourage users to use <a shape="rect" href="cxf.html">CXF</a> instead of Axis.</p></div></div>
 
 <style type="text/css">/*<![CDATA[*/
-div.rbtoc1459498721538 {padding: 0px;}
-div.rbtoc1459498721538 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1459498721538 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1459505891453 {padding: 0px;}
+div.rbtoc1459505891453 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1459505891453 li {margin-left: 0px;padding-left: 0px;}
 
-/*]]>*/</style><div class="toc-macro rbtoc1459498721538">
+/*]]>*/</style><div class="toc-macro rbtoc1459505891453">
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-TutorialusingAxis1.4withApacheCamel">Tutorial using Axis 1.4 with Apache Camel</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-Prerequisites">Prerequisites</a></li><li><a shape="rect" href="#BookInOnePage-Distribution">Distribution</a></li><li><a shape="rect" href="#BookInOnePage-Introduction">Introduction</a></li><li><a shape="rect" href="#BookInOnePage-SettinguptheprojecttorunAxis">Setting up the project to run Axis</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-Maven2">Maven 2</a></li><li><a shape="rect" href="#BookInOnePage-wsdl">wsdl</a></li><li><a shape="rect" href="#BookInOnePage-ConfiguringAxis">Configuring Axis</a></li><li><a shape="rect" href="#BookInOnePage-RunningtheExample">Running the Example</a></li></ul>
@@ -17281,11 +17281,11 @@ template.send(&quot;direct:alias-verify&
 ]]></script>
 </div></div><p></p><h3 id="BookInOnePage-SeeAlso.28">See Also</h3>
 <ul><li><a shape="rect" href="configuring-camel.html">Configuring Camel</a></li><li><a shape="rect" href="component.html">Component</a></li><li><a shape="rect" href="endpoint.html">Endpoint</a></li><li><a shape="rect" href="getting-started.html">Getting Started</a></li></ul><ul><li><a shape="rect" href="crypto.html">Crypto</a> Crypto is also available as a <a shape="rect" href="data-format.html">Data Format</a></li></ul> <h2 id="BookInOnePage-CXFComponent">CXF Component</h2><div class="confluence-information-macro confluence-information-macro-note"><span class="aui-icon aui-icon-small aui-iconfont-warning confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>When using CXF as a consumer, the <a shape="rect" href="cxf-bean-component.html">CXF Bean Component</a> allows you to factor out how message payloads are received from their processing as a RESTful or SOAP web service. This has the potential of using a multitude of transports to consume web 
 services. The bean component's configuration is also simpler and provides the fastest method to implement web services using Camel and CXF.</p></div></div><div class="confluence-information-macro confluence-information-macro-tip"><span class="aui-icon aui-icon-small aui-iconfont-approve confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>When using CXF in streaming modes (see DataFormat option), then also read about <a shape="rect" href="stream-caching.html">Stream caching</a>.</p></div></div><p>The <strong>cxf:</strong> component provides integration with <a shape="rect" href="http://cxf.apache.org">Apache CXF</a> for connecting to JAX-WS services hosted in CXF.</p><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1459498761904 {padding: 0px;}
-div.rbtoc1459498761904 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1459498761904 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1459505909669 {padding: 0px;}
+div.rbtoc1459505909669 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1459505909669 li {margin-left: 0px;padding-left: 0px;}
 
-/*]]>*/</style></p><div class="toc-macro rbtoc1459498761904">
+/*]]>*/</style></p><div class="toc-macro rbtoc1459505909669">
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-CXFComponent">CXF Component</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-URIformat">URI format</a></li><li><a shape="rect" href="#BookInOnePage-Options">Options</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-Thedescriptionsofthedataformats">The descriptions of the dataformats</a>
@@ -21925,7 +21925,7 @@ monitor.start();
     &lt;!-- use the same version as your Camel core version --&gt;
 &lt;/dependency&gt;
 ]]></script>
-</div></div><h3 id="BookInOnePage-Sendingtotheendpoint.2">Sending to the endpoint</h3><p>You can store a Java entity bean in a database by sending it to a JPA producer endpoint. The body of the <em>In</em> message is assumed to be an entity bean (that is, a POJO with an <a shape="rect" class="external-link" href="http://java.sun.com/javaee/5/docs/api/javax/persistence/Entity.html" rel="nofollow">@Entity</a> annotation on it) or a collection or array of entity beans.</p><p>If the body is a List of entities, make sure to use <strong>entityType=java.util.ArrayList</strong> as a configuration passed to the producer endpoint.</p><p>If the body does not contain one of the previous listed types, put a <a shape="rect" href="message-translator.html">Message Translator</a> in front of the endpoint to perform the necessary conversion first.</p><h3 id="BookInOnePage-Consumingfromtheendpoint.2">Consuming from the endpoint</h3><p>Consuming messages from a JPA consumer endpoint removes (or updates
 ) entity beans in the database. This allows you to use a database table as a logical queue: consumers take messages from the queue and then delete/update them to logically remove them from the queue.</p><p>If you do not wish to delete the entity bean when it has been processed (and when routing is done), you can specify <code>consumeDelete=false</code> on the URI. This will result in the entity being processed each poll.</p><p>If you would rather perform some update on the entity to mark it as processed (such as to exclude it from a future query) then you can annotate a method with <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-jpa/apidocs/org/apache/camel/component/jpa/Consumed.html">@Consumed</a> which will be invoked on your entity bean when the entity bean when it has been processed (and when routing is done).</p><p>From <strong>Camel 2.13</strong> onwards you can use <a shape="rect" class="external-link" href="http://camel.apache.org/mav
 en/current/camel-jpa/apidocs/org/apache/camel/component/jpa/PreConsumed.html">@PreConsumed</a> which will be invoked on your entity bean before it has been processed (before routing).</p><h3 id="BookInOnePage-URIformat.36">URI format</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="BookInOnePage-Sendingtotheendpoint.2">Sending to the endpoint</h3><p>You can store a Java entity bean in a database by sending it to a JPA producer endpoint. The body of the <em>In</em> message is assumed to be an entity bean (that is, a POJO with an <a shape="rect" class="external-link" href="http://java.sun.com/javaee/5/docs/api/javax/persistence/Entity.html" rel="nofollow">@Entity</a> annotation on it) or a collection or array of entity beans.</p><p>If the body is a List of entities, make sure to use <strong>entityType=java.util.ArrayList</strong> as a configuration passed to the producer endpoint.</p><p>If the body does not contain one of the previous listed types, put a <a shape="rect" href="message-translator.html">Message Translator</a> in front of the endpoint to perform the necessary conversion first.</p><h3 id="BookInOnePage-Consumingfromtheendpoint.2">Consuming from the endpoint</h3><p>Consuming messages from a JPA consumer endpoint removes (or updates
 ) entity beans in the database. This allows you to use a database table as a logical queue: consumers take messages from the queue and then delete/update them to logically remove them from the queue.</p><p>If you do not wish to delete the entity bean when it has been processed (and when routing is done), you can specify <code>consumeDelete=false</code> on the URI. This will result in the entity being processed each poll.</p><p>If you would rather perform some update on the entity to mark it as processed (such as to exclude it from a future query) then you can annotate a method with <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-jpa/apidocs/org/apache/camel/component/jpa/Consumed.html">@Consumed</a> which will be invoked on your entity bean when the entity bean when it has been processed (and when routing is done).</p><p>From <strong>Camel 2.13</strong> onwards you can use <a shape="rect" class="external-link" href="http://camel.apache.org/mav
 en/current/camel-jpa/apidocs/org/apache/camel/component/jpa/PreConsumed.html">@PreConsumed</a> which will be invoked on your entity bean before it has been processed (before routing).</p><p>If you are consuming a lot (100K+) of rows and experience OutOfMemory problems you should set the maximumResults to sensible value.</p><h3 id="BookInOnePage-URIformat.36">URI format</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[jpa:entityClassName[?options]
 ]]></script>
 </div></div><p>For sending to the endpoint, the <em>entityClassName</em> is optional. If specified, it helps the <a shape="rect" href="type-converter.html">Type Converter</a> to ensure the body is of the correct type.</p><p>For consuming, the <em>entityClassName</em> is mandatory.</p><p>You can append query options to the URI in the following format, <code>?option=value&amp;option=value&amp;...</code></p><h3 id="BookInOnePage-Options.50">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>entityType</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>entityClassName</em></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Overrides the <em>entityClassName</e
 m> from the URI.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>persistenceUnit</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>camel</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The JPA persistence unit used by default.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumeDelete</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>JPA consumer only:</strong> If <code>true</code>, the entity is deleted after it is consumed; if <code>false</code>, the entity is not deleted.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumeLockEntity</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>JPA consumer only:</strong> Specifies whether or not to set an exclus
 ive lock on each entity bean while processing the results from polling.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>flushOnSend</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>JPA producer only:</strong> Flushes the <a shape="rect" class="external-link" href="http://java.sun.com/javaee/5/docs/api/javax/persistence/EntityManager.html" rel="nofollow">EntityManager</a> after the entity bean has been persisted.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>maximumResults</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>JPA consumer only:</strong> Set the maximum number of results to retrieve on the <a shape="rect" class="external-link" href="http://java.sun.com/javaee/5/docs/api/javax/persistence/Query.html" rel="nofollow">Q
 uery</a>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>transactionManager</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>This option is <a shape="rect" href="registry.html">Registry</a> based which requires the <code>#</code> notation so that the given <code>transactionManager</code> being specified can be looked up properly, e.g. <code>transactionManager=#myTransactionManager</code>. It specifies the transaction manager to use. If none provided, Camel will use a <code>JpaTransactionManager</code> by default. Can be used to set a JTA transaction manager (for integration with an EJB container).</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.delay</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>500</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>JPA consumer only:</strong
 > Delay in milliseconds between each poll.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.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>JPA consumer only:</strong> Milliseconds before polling starts.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.useFixedDelay</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>JPA consumer only:</strong> Set to <code>true</code> to use fixed delay between polls, otherwise fixed rate is used. See <a shape="rect" class="external-link" href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ScheduledExecutorService.html" rel="nofollow">ScheduledExecutorService</a> in JDK for details.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><
 p><code>maxMessagesPerPoll</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>0</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>JPA consumer only:</strong> An integer value to define the maximum number of messages to gather per poll. By default, no maximum is set. Can be used to avoid polling many thousands of messages when starting up the server. Set a value of 0 or negative to disable.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.query</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>JPA consumer only:</strong> To use a custom query when consuming data.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.namedQuery</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>JPA consumer only
 :</strong> To use a named query when consuming data.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.nativeQuery</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>JPA consumer only:</strong> To use a custom native query when consuming data. You may want to use the option <code>consumer.resultClass</code> also when using native queries.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.parameters</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12: JPA consumer only:</strong> This option is <a shape="rect" href="registry.html">Registry</a> based which requires the <code>#</code> notation. This key/value mapping is used for building the query parameters. It's is expected to be of the generic type <code>java.util.Map&lt;String,
  Object&gt;</code> where the keys are the named parameters of a given JPA query and the values are their corresponding effective values you want to select for.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.resultClass</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.7: JPA consumer only:</strong> Defines the type of the returned payload (we will call <code>entityManager.createNativeQuery(nativeQuery, resultClass)</code> instead of <code>entityManager.createNativeQuery(nativeQuery)</code>). Without this option, we will return an object array. Only has an affect when using in conjunction with native query when consuming data.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.transacted</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="co
 nfluenceTd"><p><strong>Camel 2.7.5/2.8.3/2.9: JPA consumer only:</strong> Whether to run the consumer in transacted mode, by which all messages will either commit or rollback, when the entire batch has been processed. The default behavior (false) is to commit all the previously successfully processed messages, and only rollback the last failed message.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.lockModeType</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>WRITE</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.11.2/2.12:</strong> To configure the lock mode on the consumer. The possible values is defined in the enum <code>javax.persistence.LockModeType</code>. The default value is changed to <code>PESSIMISTIC_WRITE</code> since <strong>Camel 2.13</strong>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.SkipLockedEntity</code></p></td><td colspan="1" r
 owspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.13:</strong> To configure whether to use NOWAIT on lock and silently skip the entity.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>usePersist</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.5: JPA producer only:</strong> Indicates to use <code>entityManager.persist(entity)</code> instead of <code>entityManager.merge(entity)</code>. Note: <code>entityManager.persist(entity)</code> doesn't work for detached entities (where the EntityManager has to execute an UPDATE instead of an INSERT query)!</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>joinTransaction</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="conflue
 nceTd"><p><strong>Camel 2.12.3:</strong> camel-jpa will join transaction by default from Camel 2.12 onwards. You can use this option to turn this off, for example if you use LOCAL_RESOURCE and join transaction doesn't work with your JPA provider. This option can also be set globally on the <code>JpaComponent</code>, instead of having to set it on all endpoints.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p class="p1">usePassedInEntityManager</p></td><td colspan="1" rowspan="1" class="confluenceTd">false</td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.12.4/2.13.1 JPA producer only:</strong> If set to true, then Camel will use the EntityManager from the header<p class="p1">JpaConstants.ENTITYMANAGER instead of the configured entity manager on the component/endpoint. This allows end users to control which entity manager will be in use.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">sharedEntityManager</td><td colspan="1" ro
 wspan="1" class="confluenceTd">false</td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.16:</strong>&#160;whether to use spring's SharedEntityManager for the consumer/producer. A good idea may be to set joinTransaction=false if this option is true, as sharing the entity manager and mixing transactions is not a good idea.</td></tr></tbody></table></div><h3 id="BookInOnePage-MessageHeaders.10">Message Headers</h3><p>Camel adds the following message headers to the exchange:</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Header</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>CamelJpaTemplate</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>JpaTemplate</code></p></td><td colspan=
 "1" rowspan="1" class="confluenceTd"><p><strong>Not supported anymore since Camel 2.12:</strong> The <code>JpaTemplate</code> object that is used to access the entity bean. You need this object in some situations, for instance in a type converter or when you are doing some custom processing. See <a shape="rect" class="external-link" href="https://issues.apache.org/jira/browse/CAMEL-5932">CAMEL-5932</a> for the reason why the support for this header has been dropped.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelEntityManager</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>EntityManager</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12: JPA consumer / Camel 2.12.2: JPA producer:</strong> The JPA <code>EntityManager</code> object being used by <code>JpaConsumer</code> or <code>JpaProducer</code>.</p></td></tr></tbody></table></div></div><h3 id="BookInOnePage-ConfiguringEntityManagerFactory">
 Configuring EntityManagerFactory</h3><p>Its strongly advised to configure the JPA component to use a specific <code>EntityManagerFactory</code> instance. If failed to do so each <code>JpaEndpoint</code> will auto create their own instance of <code>EntityManagerFactory</code> which most often is not what you want.</p><p>For example, you can instantiate a JPA component that references the <code>myEMFactory</code> entity manager factory, as follows:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">

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

Modified: websites/production/camel/content/jpa.html
==============================================================================
--- websites/production/camel/content/jpa.html (original)
+++ websites/production/camel/content/jpa.html Fri Apr  1 10:19:47 2016
@@ -94,7 +94,7 @@
     &lt;!-- use the same version as your Camel core version --&gt;
 &lt;/dependency&gt;
 ]]></script>
-</div></div><h3 id="JPA-Sendingtotheendpoint">Sending to the endpoint</h3><p>You can store a Java entity bean in a database by sending it to a JPA producer endpoint. The body of the <em>In</em> message is assumed to be an entity bean (that is, a POJO with an <a shape="rect" class="external-link" href="http://java.sun.com/javaee/5/docs/api/javax/persistence/Entity.html" rel="nofollow">@Entity</a> annotation on it) or a collection or array of entity beans.</p><p>If the body is a List of entities, make sure to use <strong>entityType=java.util.ArrayList</strong> as a configuration passed to the producer endpoint.</p><p>If the body does not contain one of the previous listed types, put a <a shape="rect" href="message-translator.html">Message Translator</a> in front of the endpoint to perform the necessary conversion first.</p><h3 id="JPA-Consumingfromtheendpoint">Consuming from the endpoint</h3><p>Consuming messages from a JPA consumer endpoint removes (or updates) entity beans in the da
 tabase. This allows you to use a database table as a logical queue: consumers take messages from the queue and then delete/update them to logically remove them from the queue.</p><p>If you do not wish to delete the entity bean when it has been processed (and when routing is done), you can specify <code>consumeDelete=false</code> on the URI. This will result in the entity being processed each poll.</p><p>If you would rather perform some update on the entity to mark it as processed (such as to exclude it from a future query) then you can annotate a method with <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-jpa/apidocs/org/apache/camel/component/jpa/Consumed.html">@Consumed</a> which will be invoked on your entity bean when the entity bean when it has been processed (and when routing is done).</p><p>From <strong>Camel 2.13</strong> onwards you can use <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-jpa/api
 docs/org/apache/camel/component/jpa/PreConsumed.html">@PreConsumed</a> which will be invoked on your entity bean before it has been processed (before routing).</p><h3 id="JPA-URIformat">URI format</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="JPA-Sendingtotheendpoint">Sending to the endpoint</h3><p>You can store a Java entity bean in a database by sending it to a JPA producer endpoint. The body of the <em>In</em> message is assumed to be an entity bean (that is, a POJO with an <a shape="rect" class="external-link" href="http://java.sun.com/javaee/5/docs/api/javax/persistence/Entity.html" rel="nofollow">@Entity</a> annotation on it) or a collection or array of entity beans.</p><p>If the body is a List of entities, make sure to use <strong>entityType=java.util.ArrayList</strong> as a configuration passed to the producer endpoint.</p><p>If the body does not contain one of the previous listed types, put a <a shape="rect" href="message-translator.html">Message Translator</a> in front of the endpoint to perform the necessary conversion first.</p><h3 id="JPA-Consumingfromtheendpoint">Consuming from the endpoint</h3><p>Consuming messages from a JPA consumer endpoint removes (or updates) entity beans in the da
 tabase. This allows you to use a database table as a logical queue: consumers take messages from the queue and then delete/update them to logically remove them from the queue.</p><p>If you do not wish to delete the entity bean when it has been processed (and when routing is done), you can specify <code>consumeDelete=false</code> on the URI. This will result in the entity being processed each poll.</p><p>If you would rather perform some update on the entity to mark it as processed (such as to exclude it from a future query) then you can annotate a method with <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-jpa/apidocs/org/apache/camel/component/jpa/Consumed.html">@Consumed</a> which will be invoked on your entity bean when the entity bean when it has been processed (and when routing is done).</p><p>From <strong>Camel 2.13</strong> onwards you can use <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-jpa/api
 docs/org/apache/camel/component/jpa/PreConsumed.html">@PreConsumed</a> which will be invoked on your entity bean before it has been processed (before routing).</p><p>If you are consuming a lot (100K+) of rows and experience OutOfMemory problems you should set the maximumResults to sensible value.</p><h3 id="JPA-URIformat">URI format</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[jpa:entityClassName[?options]
 ]]></script>
 </div></div><p>For sending to the endpoint, the <em>entityClassName</em> is optional. If specified, it helps the <a shape="rect" href="type-converter.html">Type Converter</a> to ensure the body is of the correct type.</p><p>For consuming, the <em>entityClassName</em> is mandatory.</p><p>You can append query options to the URI in the following format, <code>?option=value&amp;option=value&amp;...</code></p><h3 id="JPA-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>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>entityType</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>entityClassName</em></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Overrides the <em>entityClassName</em> from the U
 RI.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>persistenceUnit</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>camel</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The JPA persistence unit used by default.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumeDelete</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>JPA consumer only:</strong> If <code>true</code>, the entity is deleted after it is consumed; if <code>false</code>, the entity is not deleted.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumeLockEntity</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>JPA consumer only:</strong> Specifies whether or not to set an exclusive lock on e
 ach entity bean while processing the results from polling.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>flushOnSend</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>JPA producer only:</strong> Flushes the <a shape="rect" class="external-link" href="http://java.sun.com/javaee/5/docs/api/javax/persistence/EntityManager.html" rel="nofollow">EntityManager</a> after the entity bean has been persisted.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>maximumResults</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>JPA consumer only:</strong> Set the maximum number of results to retrieve on the <a shape="rect" class="external-link" href="http://java.sun.com/javaee/5/docs/api/javax/persistence/Query.html" rel="nofollow">Query</a>.</p>
 </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>transactionManager</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>This option is <a shape="rect" href="registry.html">Registry</a> based which requires the <code>#</code> notation so that the given <code>transactionManager</code> being specified can be looked up properly, e.g. <code>transactionManager=#myTransactionManager</code>. It specifies the transaction manager to use. If none provided, Camel will use a <code>JpaTransactionManager</code> by default. Can be used to set a JTA transaction manager (for integration with an EJB container).</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.delay</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>500</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>JPA consumer only:</strong> Delay in mi
 lliseconds between each poll.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.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>JPA consumer only:</strong> Milliseconds before polling starts.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.useFixedDelay</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>JPA consumer only:</strong> Set to <code>true</code> to use fixed delay between polls, otherwise fixed rate is used. See <a shape="rect" class="external-link" href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ScheduledExecutorService.html" rel="nofollow">ScheduledExecutorService</a> in JDK for details.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>maxMe
 ssagesPerPoll</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>0</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>JPA consumer only:</strong> An integer value to define the maximum number of messages to gather per poll. By default, no maximum is set. Can be used to avoid polling many thousands of messages when starting up the server. Set a value of 0 or negative to disable.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.query</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>JPA consumer only:</strong> To use a custom query when consuming data.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.namedQuery</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>JPA consumer only:</strong> To
  use a named query when consuming data.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.nativeQuery</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>JPA consumer only:</strong> To use a custom native query when consuming data. You may want to use the option <code>consumer.resultClass</code> also when using native queries.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.parameters</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12: JPA consumer only:</strong> This option is <a shape="rect" href="registry.html">Registry</a> based which requires the <code>#</code> notation. This key/value mapping is used for building the query parameters. It's is expected to be of the generic type <code>java.util.Map&lt;String, Object&gt;</
 code> where the keys are the named parameters of a given JPA query and the values are their corresponding effective values you want to select for.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.resultClass</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.7: JPA consumer only:</strong> Defines the type of the returned payload (we will call <code>entityManager.createNativeQuery(nativeQuery, resultClass)</code> instead of <code>entityManager.createNativeQuery(nativeQuery)</code>). Without this option, we will return an object array. Only has an affect when using in conjunction with native query when consuming data.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.transacted</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.7.5/2.8.3/2.9: JPA consumer only:</strong> Whether to run the consumer in transacted mode, by which all messages will either commit or rollback, when the entire batch has been processed. The default behavior (false) is to commit all the previously successfully processed messages, and only rollback the last failed message.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.lockModeType</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>WRITE</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.11.2/2.12:</strong> To configure the lock mode on the consumer. The possible values is defined in the enum <code>javax.persistence.LockModeType</code>. The default value is changed to <code>PESSIMISTIC_WRITE</code> since <strong>Camel 2.13</strong>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.SkipLockedEntity</code></p></td><td colspan="1" rowspan="1" cl
 ass="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.13:</strong> To configure whether to use NOWAIT on lock and silently skip the entity.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>usePersist</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.5: JPA producer only:</strong> Indicates to use <code>entityManager.persist(entity)</code> instead of <code>entityManager.merge(entity)</code>. Note: <code>entityManager.persist(entity)</code> doesn't work for detached entities (where the EntityManager has to execute an UPDATE instead of an INSERT query)!</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>joinTransaction</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><st
 rong>Camel 2.12.3:</strong> camel-jpa will join transaction by default from Camel 2.12 onwards. You can use this option to turn this off, for example if you use LOCAL_RESOURCE and join transaction doesn't work with your JPA provider. This option can also be set globally on the <code>JpaComponent</code>, instead of having to set it on all endpoints.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p class="p1">usePassedInEntityManager</p></td><td colspan="1" rowspan="1" class="confluenceTd">false</td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.12.4/2.13.1 JPA producer only:</strong> If set to true, then Camel will use the EntityManager from the header<p class="p1">JpaConstants.ENTITYMANAGER instead of the configured entity manager on the component/endpoint. This allows end users to control which entity manager will be in use.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">sharedEntityManager</td><td colspan="1" rowspan="1" cla
 ss="confluenceTd">false</td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.16:</strong>&#160;whether to use spring's SharedEntityManager for the consumer/producer. A good idea may be to set joinTransaction=false if this option is true, as sharing the entity manager and mixing transactions is not a good idea.</td></tr></tbody></table></div><h3 id="JPA-MessageHeaders">Message Headers</h3><p>Camel adds the following message headers to the exchange:</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Header</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>CamelJpaTemplate</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>JpaTemplate</code></p></td><td colspan="1" rowspan="1" class="con
 fluenceTd"><p><strong>Not supported anymore since Camel 2.12:</strong> The <code>JpaTemplate</code> object that is used to access the entity bean. You need this object in some situations, for instance in a type converter or when you are doing some custom processing. See <a shape="rect" class="external-link" href="https://issues.apache.org/jira/browse/CAMEL-5932">CAMEL-5932</a> for the reason why the support for this header has been dropped.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelEntityManager</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>EntityManager</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12: JPA consumer / Camel 2.12.2: JPA producer:</strong> The JPA <code>EntityManager</code> object being used by <code>JpaConsumer</code> or <code>JpaProducer</code>.</p></td></tr></tbody></table></div></div><h3 id="JPA-ConfiguringEntityManagerFactory">Configuring EntityManagerFactory</h3
 ><p>Its strongly advised to configure the JPA component to use a specific <code>EntityManagerFactory</code> instance. If failed to do so each <code>JpaEndpoint</code> will auto create their own instance of <code>EntityManagerFactory</code> which most often is not what you want.</p><p>For example, you can instantiate a JPA component that references the <code>myEMFactory</code> entity manager factory, as follows:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">