Skip to main content

Integration Project- Micro Services Migration Story with JBoss BPM Travel Agency - Part One

Part One - Introduction and Installation


While ago, Eric Schabell launched a project showing various interesting feature of JBoss BPM suite. It's based on a Travel agency story, Eric has made a series of video and blog to walkthrough the installation of both product and project and also shows the possible implementation of how to use rules and processes within BPM suite. This comprehensive demo covers a lot of functions, with  a bookings process for both flights and Hotel, with a payment process that included advanced features like compensation (rolling back bookings), integration of traditional web services in service tasks and a credit card fraud detection system.

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:
We will see now the hotel services are broken down into 3 sections, with a messaging broker in between to achieve asynchronize architecture.Now each service only handles one single simple job. Not only it much easier for developer to maintain without them going through a big chunk of code, because the nature in Fuse, where it is really easy and quick to spin up a container, therefore we can even deploy these services separately to make it more flexible to distribute your load and also more agile. Developer can push their code more frequently without worrying about whether it's going to affect other services.

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.

CAUTION:
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)

Installation

  1. Download and unzip.
  2. Add products to installs directory.
  3. In JBoss BPM suite, run 'init.sh' or 'init.bat' file. 'init.bat' must be run with Administrative privileges.
  4. 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!).
  5. 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
      
      
      
  6. Start Fuse Server, by running 'fuse' or 'fuse.bat':
  7. Login to Fuse management console at: http://localhost:8181 (u:admin/p:admin).
  8. 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!

Comments

Silke + Maurice said…
Loved your post, this confirms the ideas i am implementing right now.
Anonymous said…
Hi Christina,

I cannot download the JBoss Fuse 6.1.1 on http://www.jboss.org/downloads/. And now with the delivery fuse 6.2.0 (jboss-fuse-full-6.2.0.redhat-133.zip) the demo source needs to be updated. I changed couple of files in installs and support diretories but did not manage to go further than this point :
Fuse sources are present...

BPM sources are present...

Product installer running now...

Error: Unable to access jarfile C:\dev\bpms-fuse-travel-agency-integration-demo-master\installs/
Error Occurred During Installation!

Thanks for your help.

Philippe
Jhony Bairstow said…
I guess I have selected a mind blowing and interesting blog. central asia tourism
Jason statham said…
The people not reading your blogs are missing out a lot of quality contents. quality wordpress themes

Popular posts from this blog

Red Hat Fuse - Announcing Fuse 7 Tech preview 3 release.

Red Hat Fuse 7.0 technical preview three is out today! On the pathway to become one of the best cloud-native integration platform, Fuse gives developer freedom to choose how they want to develop the integration solution, where they want to deploy it and capabilities to address new integration personas that do not have development experience.
By supporting the three major runtime, developer is free to work on the runtime of their choice.By supporting standalone and cloud deployment, it simplifies the complexity to distinguish between these environments, allowing application to deploy freely among the environment of your choice. All levels of developers are welcome, you can either dive deep into creating customize complex integration logic, or using the new low code platform to quickly build a simple integration. In this Tech Preview release you get it all.
Fuse StandaloneSpring-boot for microserviceKaraf 4 for OSGi loverJBoss EAP for JavaEE developersFuse on OpenShiftPlugins for easy co…

JBoss EAP 6 - 效能調校 (一) DataSource 的 Connection Pool

效能沒有什麼Best Practice, 反正能調整的就那些。 通常,一個程式的效能大概有70-80% 都跟程式怎麼寫的其實比較有關係。

最近我最疼愛的小貓Puji 因為膀胱結石開刀的時候過世了,心情很差請原諒我的口氣沒有很好,也沒有心情寫部落格。

Puji R.I.P.

=======================正文=======================

這個題目很多人叫我寫,可是這題目好大,這分明就是整死我咩~
所以我會分幾段慢慢寫。

JBoss 的 SubsystemDatasource WebWeb Service EJB Hibernate JMSJCAJVM 調校OS (作業系統)

先來看一下 DataSource Subsystem, DataSource 的部分主要是針對Connection Pool 做調校。

通常,程式都會需要跟資料庫界接,電腦在本機,尤其是在記憶體的運算很快,但是一旦要外部的資源連接,就是會非常的耗資源。所以現在的應用程式伺服器都會有個Pool 放一些先連接好的 資料庫connection,當程式有需要的時候就可以馬上提供,而不用花那些多餘的資源去連接資料庫。

這就是為什麼要針對Connection Pool 去做調校。

以下會討論到的參數,都是跟效能比較有關係,Datasource 還有很多參數,像是檢核connection 是否正確的,我都不會提到。如果你追求的是非常快速的效能,那我建議你一個檢核都不要加。當然,這樣就會為伺服器上面執行的程式帶來風險。這就是你要在效能與正確,安全性上面的取捨了。 (套句我朋友說的話,不可能又要馬兒好,又要馬兒不吃草的..)

最重要的調校參數就是 Connection 的 Pool 數量。(也就是那個Pool 裡面要放幾條的connection.) 這個參數是每一個應用程式都不一樣的。

min-pool-size 

Connection Pool 最少會存留的connection 數量

max-pool-size 

Connection Pool 最多可以開啓的 connection 數量

prefill

事先將connection pool 裡面建立好min-pool-size 的connection.

我的建議是觀察一下平常程式要用到的量設定為 min-pool-size 。
加上…

Fuse - Contract First API Design with Apicurio and Fuse/Camel - Part One

This is part one of my two-article series that demonstrates the approach of implementing contract-first API design using Apicurioand Red Hat Fuse.

It covers how to create an OpenAPI standard document as the contract between API providers and consumers using Apicurio. It also shows how to quickly create mock tests using Red Hat Fuse.

There are two common approaches of creating these APIs.
Code FirstContract First Coming from a old time ESB developer, these are not new. We have been doing this forever. Before, it was the WSDL that define the contract of the service. we were doing a lot more code first, for me it's simply because it's much easier for me to write couple of Java classes and generate the WSDL for my consumer. 

It's often pretty straightforward if the consumer of your application has finalized how they want the service to be like. But you and I all know this is not often the case. So I had to go back to my code, and make the changes accordingly and pray I did not …