Part One - Introduction and Installation
We think this could be a great story to showcase how to migrate an existing project to a more modern enterprise architecture with micro-service framework, and JBoss Fuse is the perfect solution for this. As Camel has over 150 components to choose from, and webservice is one of them, and the OSGi container is so lightweight, it'll be perfect to deploy these services on.
In the Travel agency project, you will see the entire process has few external web services calls. First of all, it needs flight and hotel data from vendors. And it needs services to book both flight or hotel and needs cancellation of the booking as well.
In the old project, all these webservices are hardcoded with only one destination available, so this time we are going to create tables in a Database that hold some flight and hotel information. And since the webservices already exists from the previous project, we are going to migrate using the WSDL to do a contract-first webservice application with no sweat.
The architecture of the hotel part on the fuse side looks like this:
Before we talk more detail about the project, let's take a look at how to run this demo. We have built a reusable project, so you can spin up the entire project with just few clicks. Play around with it first, so you get the know the story better, then explore all cool feature in the project.
You can find the project here: JBoss BPM Suite & JBoss Fuse Travel Agency Integration Demo
(The original web services sources can be found in the projects directory for your convenience, but are not built by default when we run the installation.)
You will need
- JBoss EAP 6.4
- JBoss BPM Suite 6.1
- JBoss Fuse 6.1.1.
After installing JBossBPM suite, and it's project. It'll then spins up Fuse Fabric and build, deploy the application bundles with camel routes, create these profile in JBoss Fuse. Then it automatically create containers and deploys profiles on the container. Because I am trying to demonstrate microservices in the demo, so each service will be deploy on a separate container. So you will probably find 6 more processes (containers) running the camel route, and 1 container running the message broker.
Because JBoss Fuse relays really heavily on maven, so if it's your first time running the script, please make sure you have reliable internet connection, as it's going to download around 130MB of dependencies. Once you got everything downloaded,it'll then take you few minutes to install the rest of the application. The reason it needs a few minutes to install, is because the creation of Fabric, and I want to make sure the profiles are installed correctly. (See this post about the scripts)
- Download and unzip.
- Add products to installs directory.
- In JBoss BPM suite, run 'init.sh' or 'init.bat' file. 'init.bat' must be run with Administrative privileges.
- Start the JBoss BPM Suite server, login, build and deploy JBoss BPM Suite process project at http://localhost:8080/business-central (u:erics/p:bpmsuite1!).
- Add fabric server passwords for Maven Plugin to your ~/.m2/settings.xml file the fabric server's user and password so that the maven plugin can login to the fabric.
fabric8.upload.repo admin admin
- Start Fuse Server, by running 'fuse' or 'fuse.bat':
- Login to Fuse management console at: http://localhost:8181 (u:admin/p:admin).
- Under Runtime tab, you will see 6 containers, select and start them all.
Once you are up and running just build the project in JBoss BPM Suite and start the Fuse containers as the documentation describes. You can now run the process by submitting through the client web application at: http://localhost:8080/external-client-ui-form-1.0 .
On the fuse side,
if you go down to the MQ tab, you will see the broker profile of messaging queue.
Under APIs, you will see 2 webservice exposed in fabric, It'll tell you where the webservice is located and what services and functions are provide in GUI format.
To make it more interesting, go into the individual console view, this messaging queue statistic table in within the Root container under ActiveMQ Tab.
And by going to the bookingflightcon, hotelbookingcon containers, you will find the camel route diagram under it.
And the webservices route can be found under wsflightcon and wshotelcon.
You can now start playing with the demo, and have fun.
See Eric's post for more BPM side of the story!