dutchman's log
GlassFish ESB BPEL cluster with correlation and appserver scripting
GlassFish ESB 2.1 will support GlassFish cluster. BPEL will also run clustered. Cluster support includes support for BPEL processes with correlations.
Once a BPEL process instance starts to wait for a correlated receive activity, the instance will be passivated. If the correlated input comes in to any instance of the cluster, the passivated process instance will be re-activated on that appserver instance, also if it is not the appserver instance where the original process was running, and continue where it left off when it was passivated.
To make this work, BPEL persistence must be enabled, and the BPEL engine must be running in a cluster in an appserver domain set up with the cluster profile.
I created a simple sample to show this cluster support with correlation in action. In the process of creating the sample, I also used GlassFish appserver administration scripting to create a Windows script that does:
- set up the cluster domain (called d-cluster)
- add the MySQL JDBC connector to the domain
- add a cluster (cluster1) to the domain
- add a node agent (nodeagent1) to the domain
- add two instances (instance1 and instance2) to the domain
- set up the JDBC connection pools (bpelseXA and bpelseNonXA) in the cluster, necessary for BPEL persistence
- set up the JDBC resources (jdbc/bpelseXA and jdbc/bpelseNonXA) in the cluster, needed for BPEL persistence
- install all JBI shared libraries in the cluster
- install and configure the BPEL engine in the cluster (persistence, monitoring, and KPIs are enabled by the script)
Another Windows script
- deploys and starts the sample service assembly (caBpelClusterTest)d yet another a script
Yet another Windows script
- displayer's the status of the service assembly in the cluster
And a last Windows script
- removes the cluster instances, node agent and domain created in the first script
To use the sample you should prepare your system by doing these things:
- install GlassFish ESB 2.1 (I used the nightly build of 2009-05-14)
- install SoapUI 2.5.1 (or another way to send web service messages to the service assembly)
- install MySQL server 5.1
- ensure that your MySQL server is running
- use the SQL scripts found here to create and initialise the MySQL database and user needed for BPEL persistence
-
- first use the create_bpelse_user.sql script to create the database and the user
- then log in as the user just created (bpelcluster/bpelcluster, database bpelclusterdb)
- run script create_bpelse_tables.sql to create the BPEL persistence tables
- run script create_bpelmonitor_tables.sql to create the monitoring tables
- download the GlassFish ESB sample scripts and other files needed here
- unzip this file in a directory of your choice
- open file file-store\files-to-put-here.txt and follow the instructions found in there to put the required files in there
-
- these are some files you can download from the open-esb web site, they are not included to ensure that you use the correct version of those files and to make the zip file much smaller
- change the script files in the directory where you unzipped the GlassFish ESB sample scripts
-
- change all occurrences of "c:\gf-esb" to the proper directory. This directory is used as the base directory for the scripts and for the GlassFIsh ESB installation
- change the host-name and port number of the MySQL server if they are not the default values (localhost:3306)
- run the create-and-prepare-domain-d-cluster1.cmd script
-
- follow the instructions displayed during execution of the script
- when the script finishes, you have the new d-cluster1 domain, fully prepared as described above
- run the deploy-corr-cluster-test.cmd script
-
- this will deploy and start the sample service assembly
- running script list-corr-cluster-test.cmd will display information about the service assembly (the deployment script also does that after deploying and starting the service assembly)
- once the service assembly is running, you can use SoapUI to test proper functioning. SoapUI (2.5.1) projects are found here
When you send messages to the various instances by using SoapUI, progress will be shown in the GlassFish log files of the instances. The BPEL process in the service assembly provides some logging to show what is happening. The messages to start the BPEL process and the correlated messages are InOnly, so SoapUI will not receive replies.
If you want to get rid of the domain created and everything in it, run the delete-domain-d-cluster1.cmd script.
A zip file containing the NetBeans projects for the service assembly can be downloaded here.
Posted at 12:55PM May 20, 2009 by marjo in ESB | Comments[0]
Wednesday May 20, 2009