This demo project will get you started with automatically installing two server instances, one with JBoss Data Virtualization and the other with JBoss Fuse, and then configuring the application.
-
Install JBoss Data Virtualization. Note that this also installs EAP, which is what you need to run the demos.
-
Install local development environment - JBoss Developer Studio
-
Install JBoss Fuse. Only required if it is desired to run on Fuse.
-
Install SoapUI to run the Web Service demo.
Download and unzip the archive file. If running on Windows, it is recommended the project be extracted to a location near the root drive path due to limitations of length of file/path names. Or just clone from git with git clone https://github.com/jbossdemocentral/fuse-dv-shopping-integration-demo.git
-
Install MySQL Database - http://dev.mysql.com/downloads/. Keep the admin password as root.
-
Install MySQL Workbench - http://dev.mysql.com/downloads/workbench/
-
Start server using command 'sudo mysqld_safe &'
-
Open Workbench
-
Open SQL Tab to execute the content of the following query: support/sql-support/init_mysql.sql
-
Install the PostgreSQL server (http://www.postgresql.org/download/). Keep the admin password as postgres.
-
Open SQL Tab to execute the content of the following query: support/sql-support/init_postgres.sql
Note that this also installs EAP, so this is all you need to run the demos.
-
Go to http://access.redhat.com
-
Download JBoss Data Virtualization 6.1 (jboss-dv-installer-6.1.0.redhat-3.jar). Put this in the software folder in your local environment.
-
Create the folder where this will be installed: mkdir target/dv
-
Run the installer using:
java -jar jboss-dv-installer-6.1.0.redhat-3.jar
-
Select the "target/dv" folder (see screenshot) and complete the installation
- Select all products
- Choose passwords and OData enabled
- Perform the default configuration
- See key options
-
Go to http://access.redhat.com
-
Download Red Hat JBoss A-MQ 6.2.0 (jboss-a-mq-6.2.0.redhat-133.zip). Put this in the software folder in your local environment.
-
Unzip this to the target folder.
-
Unzip target/jboss-a-mq-6.2.0.redhat-133/extras/apache-activemq-5.11.0.redhat-620133-bin.zip to /support
-
Copy /support/apache-activemq-5.11.0.redhat-620133/lib/optional/activemq-rar-5.11.0.redhat-620133.rar to /target/dv/standalone/deployments
-
Go to http://access.redhat.com
-
Download and install JBoss Developer Studio - we used version 7.1.1 for development of these examples.
-
Download and install the Fuse plugin. Instructions are located at https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.1/html-single/Tooling_Installation_Guide/.
-
Install the data virtualization development plugin. Go to JBoss Central within dev studio to install. (see screenshot)
-
Import the project into eclipse as a Maven project.
Only required if it is desired to run on Fuse.
Go to http://www.soapui.org/. Download and follow the instructions to install.
The init.sh/init.bat files will be updated to complete these steps. To complete manually:
-
Install the teiid security files: copy support/dv-support/teiid-security-roles.properties AND teiid-security-users.properties to target/dv/standalone/configuration/
-
Install mysql and postgres JDBC drivers into EAP: copy support/dv-support/modules/* to target/dv/modules
-
Install the users for A-MQ: copy support/amq-support/users.properties to jboss-a-mq-6.2.0.redhat-133/etc/
-
Install the configuration file for EAP: copy support/amq-support/standalone.dv.xml to target/dv/standalone/configuration/standalone.xml
-
Install the demo virtual database: copy support/dv-support/vdb to target/dv/standalone/deployments
-
Build the project: in the projects/shopping-demo-application run mvn clean install
-
Install the WAR file into EAP: copy projects/shopping-demo-application/application-interface/target/v1.shoppingApplication.war to target/dv/standalone/deployments/shoppingApplication.war
-
Start the application server: run target/dv/bin/standalone.sh or standalone.bat
-
Start the AMQ server: run target/jboss-a-mq-6.2.0.redhat-133/bin/standalone.sh or standalone.bat
-
The page should display
-
Click show products. This calls the camel show products route which pulls back all the products from the database and displays them.
-
Open up SoapUI
-
Create new project and add the wsdl by pointing it to http://localhost:8080/shoppingApplication/services/shoppingApplication/AddNewProductsService?wsdl. Note that this is what sends the request through the Camel route. If you use the direct URL for the web service (http://localhost:8080/shoppingApplication/AddNewProductsService) then this will NOT go through Camel and will hit AddNewProductsImpl directly instead.
-
Create a sample request
-
Paste in the path to the demo products file as a URL: file:///C:/fuse-dv-shopping-integration-demo/projects/shopping-demo-application/application-interface/data/addProducts.xml
-
Run the request
-
You should then be able to click show products within the application and see new products added (just look for product names from the addProducts.xml).
-
You can also see the status of the queues that process these requests in the console window for A-MQ. Use the command "activemq:dstat".
NOTE: Once you run this, it will fail on subsequent requests to add the same products. Just go to mysql and clear out the DB to rerun.
-
You should start by running the (add products)[#add-products-by-calling-a-web-service].
-
You can then go to the twitter - https://twitter.com/shoppingapp037 - to see the products that were just added.
NOTE: this is a shared twitter account. You will get errors if you load the same products multiple times too quickly, or if another user has recently added the same products, as twitter rejects duplicate timeline posts. You can also create your own account and update the credentials in shoppingApplication.properties.
- You can go to salesforce to see the products added as well.
NOTE: this is a shared salesforce demo account and may not work reliably as credentials expire. You should update to create your own account and update the credentials in for better usage. To create an account:
Sign Up to : https://developer.salesforce.com/signup
Copy the clienId and clientSecret and other details of your account and paste it in the shoppingAppplication.properties file.
SalesForce component properties to connect
salesforce.clientId=<clientId>
salesforce.clientSecret=<secret>
salesforce.userName=<userName>
salesforce.password=<password>
- You can see the restful services by hitting them directly with the rest URL - for example: http://localhost:8080/shoppingApplication/services/rest/shoppingApplication/products/ is the URL for displaying all of the products using JSON.
The demo for this is not currently working as Google has deprecated OAUTH v1 so this component no longer functions. The team is working on resolving this issue and releasing a new version.
Red Hat Mobile is a cloud based platform to create apps which can consume MW API's. There is a demo app and hosted currently in the cloud. Details on using this are documented in the whitepaper. If you have access to the cloud, you can clone the project as follows:
Setting up Red Hat Mobile Project
- Install nodejs and npm
- Install fhc command line tool using npm: npm install -g fh-fhc
- Set the target domain to the feedhenry cloud server - fhc target
- Login to the server - fhc login
- Add the ssh key:fhc keys add <ssh_key>
- Clone the demo fuse project: fhc project clone pem6elr2gpzcnivweemw6glc //Project id of demo