Thursday, 4 August 2011

JBoss Enterprise Service Bus - Getting started (For the rest of us)

My experience of integrating enterprise software systems have driven me to write this blog.
I have used iBOLT Special Edition for SAP Business One for about 6 years, and I have respect for this platform. But, I have been at the wrong end of the customer's pointing finger enough times to decide that I will venture out and look for a more stable system. iBOLT is a great product for rapid development and stitching systems together. Having said that

The main pain points in using iBOLT in my experience have been:
  • When a iBOLT project interacts with an SAP B1 component, certain errors (depending on the versions) can cause the iBOLT server to literally terminate itself with no hope of recovering until you restart it.
  • You cannot reuse your developments in many projects (in a practical way) without plenty of work.
  • A big transaction (say 500 plus item rows in a Sales Order) can bring your entire SAP Business One database to a standstill blocking all other users while it does its thing
  • Monitoring a workflow is alot of extra work - its cheaper to simply send notifications about failures and keep retrying failed transactions.
So what are the goals, you ask? I want an integration platform to be all of the following:
  • Reliable - I must not be a gatekeeper and have to keep checking if the service is down and need to manually restart it
  • Force best practice - every different system to be integrated must expose its integration points as services, serious loose coupling
  • Reusable - all my development work must be reusable elsewhere easily
  • Agnostic design - I must not have to redevelop much if the business requirement suddenly requires transfering the source file via FTP rather than HTTP, so a component processing the file's contents must not care whether the data is coming via a different channel
  • Never lose a transaction - I dont care how long it runs or what errors it encounters, the system's workflow must never mysteriously drop a transaction
  • Traceability - I must be know (without a great deal of effort) what stage a long-running transaction is in, wherever that is in the organization's bounds
If JBoss ESB is any good, I am pretty sure that I will discover some "goals" as Iadvance in my quest.

I have an excellent mind for discovering things, and an even better one at forgetting them.
In this series of posts I will try and replicate (in as few steps as humanly possible) the steps to getting SAP Business One to work with JBoss ESB and JBoss AS. Many of the steps below have been borrowed from and I am using Windows 7 Pro.

Preparing my environment
Get a Java Development Kit (JDK 6) from
Test your installation by typing the following command in the Windows command prompt:
>>java -version
It should report a version number to you, something like "java version "1.6...."
If not, you must check your environment variable (PATH). To do this, go to
Control Panel->System->Advanced System Settings->Environment Variables->System Variables.
Look for "Path" and edit that value to include the path to your JDK bin directory. Mine is :
;C:\Program Files\Java\jdk1.6.0_25\bin

Get a stable binary distribution of ANT from install.
My version is the 1.8.2 binary distribution. Add the ANT_HOME environment variable to Windows:
Mine is -
Then go back to the "PATH" variable and append the Ant bin directory:
You might have to log off your session and back on to make sure the changes take effect.
 Now test you Ant installation by typing this command anywhere in the command window:
You should get the following error:
Buildfile: build.xml does not exist!
Build failed

Thats a great error!

Next download and install(simply extract from archive) JBoss ESB ( There are so many options with JBoss so dont just get the first distribution you see, you will lose valuable bandwidth. There are three types of distribution:
jbossesb-server-{version}, jbossesb-{version} and jbossesb-{version}-src
Choose the jbossesb-{version} because we are going to deploy it and not run it as standalone, which is what jbossesb-server-{version} is for.
We will run the JBoss ESB from the JBoss Application Server so go ahead and download this from and extract, mine is in:

Next we will get the ESB to be deployed in the JBoss application server. To do this we need to tell Ant to do all the hard work.
Go to your ESB installation's  "install" directory (mine is C:\jboss\jbossesb-4.10\jbossesb-4.10\install).
There is a configuration file there named Copy that file and rename it to Open your newly copied file and give it the path to your JBoss AS installation.
Mine reads:  
and the JBoss AS configuration to use can be left like this:

Save the file and then using your command window, change directory to the install directory
Mine is (CD C:\jboss\jbossesb-4.10\jbossesb-4.10\install)
then type
Now Ant will package the ESB and plug it into the AS deploy directory.
I checked mine in C:\jboss\jboss-4.2.3.GA\jboss-4.2.3.GA\server\default\deploy

Moment of truth
Now you can start your JBoss AS server
Change directory to the bin : (Mine is C:\jboss\jboss-4.2.3.GA\jboss-4.2.3.GA\bin)
Then type
JBoss should then roar to life (it says alot of stuff that means nothing to me). Towards the end of the messages, you should see something like "..INFO  [Http11Protocol] Starting Coyote HTTP/1.1 on http-"
Now we are cooking with gas, mate!
Go ahead and test your hard work, open your browser and point to http://localhost:8080/
"BOO-YAH!!!" - Ok, maybe not so exciting but it took me two days to get it this easy, lucky for you.
If you go to http://localhost:8080/web-console/ you will see a menu on the left hand side. Expand "J2EE Domains->jboss management local->JBoss"
There, look for references to "jbossesb-registry.sar, jbossesb.sar,jbrules-service.xml and jbpm-service.xml".

JBossESB ships with a number of standard service archives:

    jbossesb.esb - internal services like the DeadLetterService,
    jbrules.esb - needed for rules evaluation using JBossRules, for services like the Content-Based Router, and
    jbpm.esb - needed for default provider of Business Process Management jBPM.

The Hello World QuickStart

This QuickStart allows you get up and running with JBossESB, out of the box. It is located in the ESB distribution under samples/quickstarts/helloworld.
To run this QuickStart:
  1. Start your Server(if not running already) in a way that allows you to view the output console. If you are on Windows, it is preferable not to run JBoss as a Windows Service for the purposes of this guide.
  2. From a command terminal window, change directory into the samples/quickstarts/helloworld directory.
  3. Make sure that install/ has the correct configuration and home directory settings for your server -- just a note, you have already done this step
  4. Type “ant deploy” to deploy the helloworld .esb package archive to your application server.
  5. Type “ant runtest”.
  6. Switch back to your application server's console. You should soon see a “Hello World” message appear in your application server's console.
  7. That's it! The QuickStart ran successfully. Your environment is properly configured for JBossESB.

 The HelloWorld logic is depicted in this url (
In my next post, we will install the development studio (JBoss Developer Studio) and link to our spanking new JBoss application server.

No comments:

Post a Comment