camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/2] camel git commit: CAMEL-10077 Removed snippet from adoc
Date Tue, 02 Aug 2016 18:04:38 GMT
CAMEL-10077 Removed snippet from adoc


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2dc74c6b
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2dc74c6b
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2dc74c6b

Branch: refs/heads/master
Commit: 2dc74c6be38cc12122d3288209e74ec316f993f9
Parents: 00fef58
Author: Darius <dariuscooper@gmail.com>
Authored: Tue Aug 2 13:21:33 2016 -0400
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Tue Aug 2 20:04:29 2016 +0200

----------------------------------------------------------------------
 camel-core/src/main/docs/file.adoc | 32 +++++++++++++++++++++++++++-----
 1 file changed, 27 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/2dc74c6b/camel-core/src/main/docs/file.adoc
----------------------------------------------------------------------
diff --git a/camel-core/src/main/docs/file.adoc b/camel-core/src/main/docs/file.adoc
index 0236e8c..8f92976 100644
--- a/camel-core/src/main/docs/file.adoc
+++ b/camel-core/src/main/docs/file.adoc
@@ -900,14 +900,36 @@ First we need a persistence-unit in `META-INF/persistence.xml` where
we
 need to use the class
 `org.apache.camel.processor.idempotent.jpa.MessageProcessed` as model.
 
-Then we need to setup a Spring `jpaTemplate` in the spring XML file:
-
-Error formatting macro: snippet: java.lang.IndexOutOfBoundsException:
-Index: 20, Size: 20
+[source,xml]
+---------------------------------------------------------------------------------
+<persistence-unit name="idempotentDb" transaction-type="RESOURCE_LOCAL">
+  <class>org.apache.camel.processor.idempotent.jpa.MessageProcessed</class>
+ 
+  <properties>
+    <property name="openjpa.ConnectionURL" value="jdbc:derby:target/idempotentTest;create=true"/>
+    <property name="openjpa.ConnectionDriverName" value="org.apache.derby.jdbc.EmbeddedDriver"/>
+    <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema"/>
+    <property name="openjpa.Log" value="DefaultLevel=WARN, Tool=INFO"/>
+    <property name="openjpa.Multithreaded" value="true"/>
+  </properties>
+</persistence-unit>
+---------------------------------------------------------------------------------
 
-And finally we can create our JPA idempotent repository in the spring
+Next, we can create our JPA idempotent repository in the spring
 XML file as well:
 
+[source,xml]
+---------------------------------------------------------------------------------
+<!-- we define our jpa based idempotent repository we want to use in the file consumer
-->
+<bean id="jpaStore" class="org.apache.camel.processor.idempotent.jpa.JpaMessageIdRepository">
+    <!-- Here we refer to the entityManagerFactory -->
+    <constructor-arg index="0" ref="entityManagerFactory"/>
+    <!-- This 2nd parameter is the name  (= a category name).
+         You can have different repositories with different names -->
+    <constructor-arg index="1" value="FileConsumer"/>
+</bean>
+---------------------------------------------------------------------------------
+
 And yes then we just need to refer to the *jpaStore* bean in the file
 consumer endpoint using the `idempotentRepository` using the `#` syntax
 option:


Mime
View raw message