Skip to content

Commit fccd5c8

Browse files
author
Wim Verreydt
committed
Update to Fuse ESB 7.1.0
1 parent 57a5cbb commit fccd5c8

File tree

6 files changed

+41
-43
lines changed

6 files changed

+41
-43
lines changed

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
target
2+
*.i??
3+
.idea
4+
.settings
5+
.project
6+
.classpath

README.md

+23-33
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
This is the material accompanying the presentation of webinar part II - Transaction Management with Fuse ESB, Camel and Persistent EIPs.
2020
It covers the different demo made during the talk and is organized like that :
2121

22-
aggregator = Camel route project to persist aggregate in H2 DB using JDBCAggregateRepository
23-
idempotent = Camel route using JPAIdempotentRepository to persist messages already processed
24-
dao = DAO layer to persist Incident record in H2 DB using OpenJPA
25-
dao-jta = Idem but configured to use JTA
26-
features = features to be deployed on Fuse ESB
27-
route-one-tx-manager = Camel routes using one Global Tx Manager (Aries Tx Manager on Fuse ESB)
28-
route-two-tx-manager = Camel routes using tewo separate Tx Managers (JMS and JDBC)
22+
- aggregator = Camel route project to persist aggregate in H2 DB using JDBCAggregateRepository
23+
- idempotent = Camel route using JPAIdempotentRepository to persist messages already processed
24+
- dao = DAO layer to persist Incident record in H2 DB using OpenJPA
25+
- dao-jta = Idem but configured to use JTA
26+
- features = features to be deployed on Fuse ESB
27+
- route-one-tx-manager = Camel routes using one Global Tx Manager (Aries Tx Manager on Fuse ESB)
28+
- route-two-tx-manager = Camel routes using tewo separate Tx Managers (JMS and JDBC)
2929

3030
# H2 DATABASE
3131

@@ -54,10 +54,14 @@ route-two-tx-manager = Camel routes using tewo separate Tx Managers (JMS and JDB
5454
Check that the records are well created using the command : SELECT * FROM REPORT.T_INCIDENT;
5555

5656

57-
# FUSE ESB INSTALLATION
57+
# FUSE ESB INSTALLATION AND CONFIGURATION
5858

59-
1. Download and install the Fuse ESB server : http://repo.fusesource.com/nexus/content/repositories/releases/org/apache/servicemix/apache-servicemix/4.4.1-fuse-01-06/
60-
2. Start Fuse ESB server /bin/karaf.sh
59+
1. Download and install the Fuse ESB : http://www.fusesource.com/downloads
60+
2. Add the following credentials to the `$FUSE_ESB_HOME>etc/users.properties` file:
61+
62+
admin=admin,admin
63+
64+
3. Start Fuse ESB server ./bin/karaf
6165

6266

6367
# Camel Route with 2 Tx Managers
@@ -68,46 +72,32 @@ To install and test, perform the following steps:
6872

6973
1. cd camel-persistence-part2/
7074
2. Run: mvn clean install
71-
72-
3. ServiceMix offers a simple JNDI implementation for OSGi, but for this example we are interested in leveraging the more sophisticated Aries JNDI
73-
lookup handler. Thus, we need to remove the ServiceMix Naming bundle as it will conflict with the Aries JNDI implementation. Run the following command:
74-
75-
list | grep -i naming | grep -i servicemix
76-
77-
Make note of the bundle id (the number inside the leftmost square brackets).
78-
79-
Run the following command:
80-
81-
uninstall <bundle-id>
82-
83-
Restart Karaf (use Ctrl-D to stop it).
84-
85-
4. Install the relevant bundles by executing the following command in the FUSE ESB console:
75+
3. Install the relevant bundles by executing the following command in the FUSE ESB console:
8676

8777
features:addurl mvn:com.fusesource.examples.camel-persistence-part2/persistence/1.0/xml/features
8878
features:install reportincident-jpa-two
8979

9080
N.B.: You may safely disregard the openjpa.Runtime Warning if it appears.
9181

92-
5. Execute the "list" command in the ESB shell and check that the following bundles are Active:
82+
4. Execute the "list" command in the ESB shell and check that the following bundles are Active:
9383

9484
[...] [Active ] [Created ] [ ] [ 60] FuseSource :: Examples :: Fuse ESB & Persistence :: Datasource (1.0)
9585
[...] [Active ] [ ] [Started] [ 60] FuseSource :: Examples :: Fuse ESB & Persistence :: DAO (1.0)
9686
[...] [Active ] [ ] [Started] [ 60] FuseSource :: Examples :: Fuse ESB & Persistence :: Camel - 2 Tx Manager (1.0)
9787

98-
6. Start H2 console and connect to the DB using the following parameters
88+
5. Start H2 console and connect to the DB using the following parameters
9989
Driver class = org.h2.Driver
10090
JDBC URL : jdbc:h2:tcp://localhost/~/reportdb
10191
User name : sa
10292
Password :
10393
10494
Run the following SQL sentence to ensure that the REPORT.T_INCIDENT is empty: SELECT * FROM REPORT.T_INCIDENT;
10595
106-
7. Launch JConsole (inside $JAVA_HOME/bin) and connect to the local process named "org.apache.karaf.main.Main". Switch to the MBeans tab at the top.
107-
On the left pane, expand the org.apache.activemq domain, then navigate to: default > Queue. You will see the incident and rollback queues.
96+
6. Launch JConsole (inside $JAVA_HOME/bin) and connect to the local process named "org.apache.karaf.main.Main". Switch to the MBeans tab at the top.
97+
On the left pane, expand the org.apache.activemq domain, then navigate to: fusemq > Queue. You will see the incident and rollback queues.
10898
The registerCall queue will appear when it is first used. For these queues, you will be interested in tracking the EnqueueCount attribute.
10999

110-
8. Copy the following files and notice the effect in the registerCall queue and the REPORT.T_INCIDENT table:
100+
7. Copy the following files and notice the effect in the registerCall queue and the REPORT.T_INCIDENT table:
111101

112102
- camel-persistence-part2/data/csv-one-record-allok.txt to $SERVICEMIX_HOME/datainsert --> record written in table, new message on registerCall queue
113103
- camel-persistence-part2/data/csv-one-record-failjms-dbok.txt to $SERVICEMIX_HOME/datainsert --> record written in table, NO new message on registerCall queue
@@ -156,9 +146,9 @@ To install and test, assuming that you have previously run the "Camel Route with
156146
SELECT * FROM CAMEL_MESSAGEPROCESSED
157147
5. Copy the following file
158148
cp cp ../data/csv-one-record.txt datainsert/
159-
6. The exchange is not filters out and camel logs that
149+
6. The exchange is not filtered out and camel logs that
160150
%%% File receive -> csv-one-record.txt
161-
7.Shutdown the camel route and restart
151+
7. Shutdown the camel route and restart
162152
Verify after copying the file that the camel route will not display the following message
163153
%%% File receive -> csv-one-record.txt
164154

@@ -170,7 +160,7 @@ To install and test, assuming that you have previously run the "Camel Route with
170160
JDBC URL : jdbc:h2:tcp://localhost/~/aggregationReport
171161
User name : sa
172162
Password :
173-
3. Create the DB using script in directory sql/init.sql
163+
3. Create the DB using script in directory src/main/resources/sql/init.sql
174164
4. Execute mvn camel:run
175165
5. Shutdown camel when 2-3 exchanges have been aggregated
176166

features/src/main/resources/reportincident.xml

+2-4
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,13 @@
1818
<feature name="reportincident-jpa-two" version="${project.version}">
1919
<feature version='${camel-version}'>camel-bindy</feature>
2020
<feature version='${camel-version}'>camel-jpa</feature>
21-
<feature version='${servicemix-version}'>camel-activemq</feature>
21+
<feature version='${activemq-version}'>activemq-camel</feature>
2222
<feature>http</feature>
2323
<feature>jdbc-driver-h2</feature>
2424
<feature>jndi</feature>
2525
<feature>transaction</feature>
2626
<feature>jpa</feature>
2727
<feature version='${spring-version}'>spring-persistence</feature>
28-
<feature version='${openjpa-version}'>openjpa</feature>
2928
<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.aspectj/1.6.8_1</bundle>
3029
<bundle>mvn:com.fusesource.examples.camel-persistence-part2/datasource/${project.version}</bundle>
3130
<bundle>mvn:com.fusesource.examples.camel-persistence-part2/dao/${project.version}</bundle>
@@ -35,14 +34,13 @@
3534
<feature name="reportincident-jpa-one" version="${project.version}">
3635
<feature version='${camel-version}'>camel-bindy</feature>
3736
<feature version='${camel-version}'>camel-jpa</feature>
38-
<feature version='${servicemix-version}'>camel-activemq</feature>
37+
<feature version='${activemq-version}'>activemq-camel</feature>
3938
<feature>http</feature>
4039
<feature>jdbc-driver-h2</feature>
4140
<feature>jndi</feature>
4241
<feature>transaction</feature>
4342
<feature>jpa</feature>
4443
<feature version='${spring-version}'>spring-persistence</feature>
45-
<feature version='${openjpa-version}'>openjpa</feature>
4644
<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.aspectj/1.6.8_1</bundle>
4745
<bundle>mvn:com.fusesource.examples.camel-persistence-part2/datasource/${project.version}</bundle>
4846
<bundle>mvn:com.fusesource.examples.camel-persistence-part2/dao-jta/${project.version}</bundle>

pom.xml

+4-6
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,14 @@
3939
<properties>
4040
<build-helper-maven-plugin-version>1.5</build-helper-maven-plugin-version>
4141
<felix-plugin-version>2.3.5</felix-plugin-version>
42-
<aries-version>0.3.1</aries-version>
43-
<activemq-version>5.5.1-fuse-01-06</activemq-version>
44-
<servicemix-version>4.4.1-fuse-01-06</servicemix-version>
45-
<openjpa-version>2.1.0</openjpa-version>
42+
<activemq-version>5.7.0.fuse-71-047</activemq-version>
43+
<openjpa-version>2.2.1</openjpa-version>
4644
<hsqldb-version>1.8.0.10</hsqldb-version>
4745
<h2-version>1.3.160</h2-version>
4846
<commons-logging-version>1.1.1</commons-logging-version>
49-
<camel-version>2.8.0-fuse-01-06</camel-version>
47+
<camel-version>2.10.0.fuse-71-047</camel-version>
5048
<openjpa-plugin-version>1.2</openjpa-plugin-version>
51-
<spring-version>3.0.5.RELEASE</spring-version>
49+
<spring-version>3.0.7.RELEASE</spring-version>
5250
<slf4j-version>1.6.1</slf4j-version>
5351
<log4j-version>1.2.12</log4j-version>
5452

route-one-tx-manager/src/main/resources/META-INF/spring/springConfig.xml

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
<!-- Create an XA-aware ActiveMQ Connection Factory -->
3535
<bean id="activemqConnectionFactoryXa" class="org.apache.activemq.ActiveMQXAConnectionFactory">
3636
<property name="brokerURL" value="tcp://localhost:61616" />
37+
<property name="userName" value="admin"/>
38+
<property name="password" value="admin"/>
3739
<property name="redeliveryPolicy">
3840
<bean class="org.apache.activemq.RedeliveryPolicy">
3941
<property name="maximumRedeliveries" value="0"/>
@@ -51,6 +53,8 @@
5153
<!-- Create a non-XA ActiveMQ Connection Factory -->
5254
<bean id="activemqConnectionFactoryNonXa" class="org.apache.activemq.ActiveMQConnectionFactory">
5355
<property name="brokerURL" value="tcp://localhost:61616" />
56+
<property name="userName" value="admin"/>
57+
<property name="password" value="admin"/>
5458
<property name="redeliveryPolicy">
5559
<bean class="org.apache.activemq.RedeliveryPolicy">
5660
<property name="maximumRedeliveries" value="0"/>

route-two-tx-manager/src/main/resources/META-INF/spring/camelContext.xml

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
<bean id="activemqConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
3939
<property name="brokerURL" value="tcp://localhost:61616" />
4040
<!-- Fail fast: no redeliveries -->
41+
<property name="userName" value="admin"/>
42+
<property name="password" value="admin"/>
4143
<property name="redeliveryPolicy">
4244
<bean class="org.apache.activemq.RedeliveryPolicy">
4345
<property name="maximumRedeliveries" value="0"/>

0 commit comments

Comments
 (0)