Author: buildbot
Date: Tue Apr 14 15:19:57 2015
New Revision: 947545
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 Tue Apr 14
15:19:57 2015
@@ -1325,11 +1325,11 @@ template.send("direct:alias-verify&
</div>
</div>
<p>The <strong>cxf:</strong> component provides integration with <a
shape="rect" href="http://cxf.apache.org">Apache CXF</a> for connecting to
JAX-WS services hosted in CXF.</p><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1429021061360 {padding: 0px;}
-div.rbtoc1429021061360 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1429021061360 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1429024664078 {padding: 0px;}
+div.rbtoc1429024664078 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1429024664078 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style></p><div class="toc-macro rbtoc1429021061360">
+/*]]>*/</style></p><div class="toc-macro rbtoc1429024664078">
<ul class="toc-indentation"><li><a shape="rect" href="#CXF-CXFComponent">CXF
Component</a>
<ul class="toc-indentation"><li><a shape="rect" href="#CXF-URIformat">URI
format</a></li><li><a shape="rect" href="#CXF-Options">Options</a>
<ul class="toc-indentation"><li><a shape="rect"
href="#CXF-Thedescriptionsofthedataformats">The descriptions of the
dataformats</a>
@@ -6585,9 +6585,7 @@ monitor.start();
</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 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 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 de
lete/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/apidocs/org/apache/camel/component/jpa/PreConsumed.html">@PreConsumed</a>
which will be invoked on your entity bean befor
e it has been processed (before routing).</p><h3
id="BookComponentAppendix-URIformat.36">URI format</h3><div class="code panel
pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[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&option=value&...</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> </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> </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> </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> </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<
;String, Object></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> </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></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" cl
ass="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-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">
+</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&option=value&...</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> </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> </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> </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> </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<
;String, Object></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> </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> 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">
<script class="theme: Default; brush: xml; gutter: false"
type="syntaxhighlighter"><![CDATA[<bean id="jpa"
class="org.apache.camel.component.jpa.JpaComponent">
<property name="entityManagerFactory"
ref="myEMFactory"/>
</bean>
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 Tue Apr 14 15:19:57
2015
@@ -4126,11 +4126,11 @@ While not actual tutorials you might fin
</div>
</div>
<h2 id="BookInOnePage-Preface">Preface</h2><p>This tutorial aims to guide the
reader through the stages of creating a project which uses Camel to facilitate
the routing of messages from a JMS queue to a <a shape="rect"
class="external-link" href="http://www.springramework.org"
rel="nofollow">Spring</a> service. The route works in a synchronous fashion
returning a response to the client.</p><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1429021087730 {padding: 0px;}
-div.rbtoc1429021087730 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1429021087730 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1429024691105 {padding: 0px;}
+div.rbtoc1429024691105 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1429024691105 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style></p><div class="toc-macro rbtoc1429021087730">
+/*]]>*/</style></p><div class="toc-macro rbtoc1429024691105">
<ul class="toc-indentation"><li><a shape="rect"
href="#Tutorial-JmsRemoting-TutorialonSpringRemotingwithJMS">Tutorial on Spring
Remoting with JMS</a></li><li><a shape="rect"
href="#Tutorial-JmsRemoting-Preface">Preface</a></li><li><a shape="rect"
href="#Tutorial-JmsRemoting-Prerequisites">Prerequisites</a></li><li><a
shape="rect"
href="#Tutorial-JmsRemoting-Distribution">Distribution</a></li><li><a
shape="rect" href="#Tutorial-JmsRemoting-About">About</a></li><li><a
shape="rect" href="#Tutorial-JmsRemoting-CreatetheCamelProject">Create the
Camel Project</a>
<ul class="toc-indentation"><li><a shape="rect"
href="#Tutorial-JmsRemoting-UpdatethePOMwithDependencies">Update the POM with
Dependencies</a></li></ul>
</li><li><a shape="rect" href="#Tutorial-JmsRemoting-WritingtheServer">Writing
the Server</a>
@@ -6316,11 +6316,11 @@ So we completed the last piece in the pi
<style type="text/css">/*<![CDATA[*/
-div.rbtoc1429021088074 {padding: 0px;}
-div.rbtoc1429021088074 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1429021088074 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1429024691449 {padding: 0px;}
+div.rbtoc1429024691449 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1429024691449 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style><div class="toc-macro rbtoc1429021088074">
+/*]]>*/</style><div class="toc-macro rbtoc1429024691449">
<ul class="toc-indentation"><li><a shape="rect"
href="#Tutorial-AXIS-Camel-TutorialusingAxis1.4withApacheCamel">Tutorial using
Axis 1.4 with Apache Camel</a>
<ul class="toc-indentation"><li><a shape="rect"
href="#Tutorial-AXIS-Camel-Prerequisites">Prerequisites</a></li><li><a
shape="rect"
href="#Tutorial-AXIS-Camel-Distribution">Distribution</a></li><li><a
shape="rect"
href="#Tutorial-AXIS-Camel-Introduction">Introduction</a></li><li><a
shape="rect" href="#Tutorial-AXIS-Camel-SettinguptheprojecttorunAxis">Setting
up the project to run Axis</a>
<ul class="toc-indentation"><li><a shape="rect"
href="#Tutorial-AXIS-Camel-Maven2">Maven 2</a></li><li><a shape="rect"
href="#Tutorial-AXIS-Camel-wsdl">wsdl</a></li><li><a shape="rect"
href="#Tutorial-AXIS-Camel-ConfiguringAxis">Configuring Axis</a></li><li><a
shape="rect" href="#Tutorial-AXIS-Camel-RunningtheExample">Running the
Example</a></li></ul>
@@ -18937,11 +18937,11 @@ template.send("direct:alias-verify&
</div>
</div>
<p>The <strong>cxf:</strong> component provides integration with <a
shape="rect" href="http://cxf.apache.org">Apache CXF</a> for connecting to
JAX-WS services hosted in CXF.</p><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1429021108134 {padding: 0px;}
-div.rbtoc1429021108134 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1429021108134 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1429024711504 {padding: 0px;}
+div.rbtoc1429024711504 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1429024711504 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style></p><div class="toc-macro rbtoc1429021108134">
+/*]]>*/</style></p><div class="toc-macro rbtoc1429024711504">
<ul class="toc-indentation"><li><a shape="rect" href="#CXF-CXFComponent">CXF
Component</a>
<ul class="toc-indentation"><li><a shape="rect" href="#CXF-URIformat">URI
format</a></li><li><a shape="rect" href="#CXF-Options">Options</a>
<ul class="toc-indentation"><li><a shape="rect"
href="#CXF-Thedescriptionsofthedataformats">The descriptions of the
dataformats</a>
@@ -24197,9 +24197,7 @@ monitor.start();
</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 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/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 pr
ocessed (before routing).</p><h3 id="BookInOnePage-URIformat.37">URI
format</h3><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[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&option=value&...</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> </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> </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> </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> </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<String,
Object></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> </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></tbody></table></div><h3
id="BookInOnePage-MessageHeaders.10">Message Headers</h3><p>Camel add
s 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" cl
ass="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">
+</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&option=value&...</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> </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> </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> </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> </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<String,
Object></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> </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> 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">
<script class="theme: Default; brush: xml; gutter: false"
type="syntaxhighlighter"><![CDATA[<bean id="jpa"
class="org.apache.camel.component.jpa.JpaComponent">
<property name="entityManagerFactory"
ref="myEMFactory"/>
</bean>
Modified: websites/production/camel/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.