$ unzip jboss-fuse-karaf-6.3.0.redhat-187.zip && cd jboss-fuse-6.3.0.redhat-187
Fuse All In One Demo
The JBoss Fuse All In One Demo will demonstrate the integration with FTP Server, REST Web Service, Mysql Database, JBoss A-MQ, JBoss BPM Suite, JBoss Data Virtualization, SAP ERP Systems, etc.
Demo Intro
In this demo, we look at some common scenarios that may arise at a FSI based customer although it’s generic enough that it could be demo’d for a broad audience too. The domain is loosely based around an event that generates a new Fund that then needs to be broadcasted to a set of interested consumers where each can handle the event separately.
There are several modules, as below figure:
-
JBoss Fuse
provide the fundamental Enterprise Service Bus and Agile Integration posibility -
FTP Server
provide the transformation and persistence capability, which is a entry point of a new transaction -
File Listener
listening onFTP Server
for any income transaction, once a new transaction come in, it will be forward to AMQ Topic -
Rest Service
provide REST API for transaction transformation, which is another entry point of a new transaction -
Rest Listener
listening onRest Service
for any income transaction, once a new transaction come in, it will be forward to AMQ Topic -
Fund Persister
consumers from a topic that represents a new fund being generated. this service is responsible for storing the Fund to a database -
Fund Processor
consumes from a topic that represents a new fund being generated. this service transforms the data and stores to a different file location. -
Rules Processor
continues to process the transaction base Business rules and stores to FTP Server -
OData Service
provides the data service for integrated data from FTP Server and Database.
Steps
0.1 - JBoss Fuse
admin=admin,admin,manager,viewer,Monitor, Operator, Maintainer, Deployer, Auditor, Administrator, SuperUser
./bin/start
0.2 - FTP Server
yum install -y vsftpd ftp
systemctl start vsftpd
# netstat -antulop | grep vsftpd
tcp6 0 0 :::21 :::* LISTEN 30569/vsftpd off (0.00/0/0)
$ ftp localhost
Trying ::1...
Connected to localhost (::1).
220 (vsFTPd 3.0.2)
Name (localhost:kylin):
331 Please specify the password.
Password:
230 Login successful.
put /home/kylin/tmp/sample.xml /home/kylin/ftp
0.3 - File Listener
-
Edit the file-listener service, make sure the ftp server directory
~/ftp
be configured as target folder, which this can be done use JBDS with Fuse Integration Plugin.
$ cd jboss-fuse-fsi-demo/file-listener && mvn clean install
cp target/file-listener-1.0-SNAPSHOT.jar ~/jboss-fuse-6.3.0.redhat-187/deploy/
0.4 - Rest Service
The Rest Service provide the same function as FTP Server, it can used to start a new fund transaction.
$ cd jboss-fuse-fsi-demo/rest-service && mvn clean install
$ java -jar target/rest-service-0.1.0.jar
The REST Service contains the following API:
0.5 - Rest Listener
The REST Listener use the CBR pattern, which provide a http proxy to REST Service.
$ cd jboss-fuse-fsi-demo/rest-listener && mvn clean install
$ ./bin/client
JBossFuse:admin@root> features:install camel-jetty
cp target/rest-listener-1.0-SNAPSHOT.jar ~/jboss-fuse-6.3.0.redhat-187/deploy/
Note that, the above rest service provide the following API:
0.6 - Mariadb
yum groupinstall mariadb mariadb-client -y
systemctl start mariadb
# mysql -u test_user -p
Enter password:
MariaDB [(none)]> use test;
MariaDB [test]> source ~/fund-persister/src/main/resources/sql/tables-mariadb.sql
0.7 - Fund Persister
$ cd jboss-fuse-fsi-demo/fund-persister && mvn clean install
$ ./bin/client
JBossFuse:admin@root> features:install camel-mybatis
cp ~/mysql-connector-java-5.1.35.jar ~/jboss-fuse-6.3.0.redhat-187/deploy/
cp target/fund-persister-1.0-SNAPSHOT.jar ~/jboss-fuse-6.3.0.redhat-187/deploy/
0.8 - Fund Processor
$ cd jboss-fuse-fsi-demo/fund-processor && mvn clean install
cp target/fund-processor-1.0-SNAPSHOT.jar ~/jboss-fuse-6.3.0.redhat-187/deploy/
0.9 - Fuse Drools Integration
unzip fuse-integration-karaf-distro-1.5.0.redhat-630018.zip -d jboss-fuse-6.3.0.redhat-187/
features:addurl mvn:org.drools/drools-karaf-features/6.5.0.Final-redhat-2/xml/features-fuse-6_3
features:addurl mvn:org.jboss.integration.fuse.quickstarts/karaf-features/1.7.0.redhat-630013/xml/features
features:install fuse-bxms-quickstart-camel-spring-drools-decision-table
1.0 - Rules Processor
$ cd jboss-fuse-fsi-demo/rules-processor && mvn clean install
cp target/rules-processor.war ~/jboss-fuse-6.3.0.redhat-187/deploy/
1.1 - JBoss Data Virtualization
$ ./bin/standalone.sh -Djboss.socket.binding.port-offset=200
$ ./bin/jboss-cli.sh --controller=127.0.0.1:10199 --connect
/subsystem=datasources/data-source=MysqlDS:add(driver-name=mysql, jndi-name=java:/MysqlDS, connection-url=jdbc:mysql://localhost:3306/test, user-name=test_user, password=redhat, enabled=true, use-java-context=true, min-pool-size=5, max-pool-size=30)
/subsystem=datasources/data-source=MysqlDS:enable()
/subsystem=datasources/data-source=MysqlDS:test-connection-in-pool()
/subsystem=resource-adapters/resource-adapter=fileQS:add(module=org.jboss.teiid.resource-adapter.file)
/subsystem=resource-adapters/resource-adapter=fileQS/connection-definitions=fileDS:add(jndi-name=java:/fileDS, class-name=org.teiid.resource.adapter.file.FileManagedConnectionFactory, enabled=true, use-java-context=true)
/subsystem=resource-adapters/resource-adapter=fileQS/connection-definitions=fileDS/config-properties=ParentDirectory:add(value=/home/kylin/tmp/output/)
/subsystem=resource-adapters/resource-adapter=fileQS/connection-definitions=fileDS/config-properties=AllowParentPaths:add(value=true)
/subsystem=resource-adapters/resource-adapter=fileQS:activate
$ cp files/sample-vdb.xml ~/jdv-6.4/standalone/deployments/
The following api is the select * from from Tables/Views:
-
http://localhost:8280/odata4/SampleVDB/MysqlSource/$metadata
-
http://localhost:8280/odata4/SampleVDB/MysqlSource/funds?$format=json
-
http://localhost:8280/odata4/SampleVDB/ViewModel/SampleView?$format=json
-
http://localhost:8280/odata4/SampleVDB/ViewModel/ComparisonView?$format=json
-
http://localhost:8280/odata4/SampleVDB/ViewModel/ComparisonView
1.2 - OData Service
$ cd jboss-fuse-fsi-demo/jdv-service && mvn clean install
cp target/jdv-service-1.0-SNAPSHOT.jar ~/jboss-fuse-6.3.0.redhat-187/deploy/
Using the following api to test the data:
-
http://localhost:8190/odata4/SampleVDB/MysqlSource/$metadata
-
http://localhost:8190/odata4/SampleVDB/MysqlSource/funds?$format=json
-
http://localhost:8190/odata4/SampleVDB/ViewModel/SampleView?$format=json
-
http://localhost:8190/odata4/SampleVDB/ViewModel/ComparisonView?$format=json
-
http://localhost:8190/odata4/SampleVDB/ViewModel/ComparisonView