This how to guide demonstrates BPEL-SE cluster support in GlassFish cluster with working samples that can be used for testing BPEL-SE running on Glassfish Cluster and to test fail-over and correlation support.
GlassFish Cluster Installation, and component installation to GlassFish Cluster, please refer to http://wiki.open-esb.java.net/Wiki.jsp?page=SettingGlassFishESBCluster
Download the project from here
. Contents of the project:
This contains a business process that reads can be fed message through http and contains a 30 seconds wait. After 30 secs, it writes to a file. The default location for the output file is C:\temp. The output file name being bpelClusterExample1_output.txt.
![]() |
The sample project used in this example uses HTTP BC to feed input and writes to File System. HTTP BC is prepackaged with JBI Envionment, hence you don't need to install the same. Following the steps as outlined for BPELSE installation, install File BC. You can download the latest file bc from filebc.jar
. Note that you need to install required shared library encoderlib.jar
before installing file bc. You can read more about file bc here
. Make sure that you choose cluster1 and mark it enabled during deployment.
You can open and build the project in Netbeans to generate the service assembpy (SA) or directly download the SA - bpelClusterExample1CompApp.zip
and deploy on the cluster1. We will use command line options to deploy and start the service assembly as there are no configurations involved.
$GLASSFISH_HOME\bin>asadmin deploy-jbi-service-assembly --target cluster1 C:\temp\bpelClusterExample1CompApp.zip
$GLASSFISH_HOME\bin>asadmin start-jbi-service-assembly --target cluster1 bpelClusterExample1CompApp
We will use Soap UI
to feed in the messages.
Note that since we did not configure the http load balancer, we will workaround by feeding messages directly to the httpbc on the respective instance. First, lets find out the port http bc is running. Navigate to GLASSFISH_HOME%\nodeagents\cluster1-nodeagent\instance-ONE\jbi\components\sun-http-binding\install_root\workspace and open config.properties and note down the value for HttpDefaultPort.
We need to configure the Soap UI to feed messages to this port. Refer screen-shots below for how to do this. For convenience the Example project include two SOAP UI project that defines one request each configured for port 2110 and 2111. You need to update these if the ports in your environment are different form these.
![]() |
![]() |
Feed one message to each of httpbc running on instance-ONE and instance-TWO. Using Netbeans database view, verify that there are two records in the STATE table of bpelse persistence database. Since there is wait of 30 seconds in the business processes, these instances are shown as running.
Refer screen-shot below taken just after feeding the messages, note the engineid for the two record indicate process instances running in two different cluster instances.
![]() |
After 30 secs, check the output file (for the attached project at C:\temp) bpelClusterExample1_output.txt. You should see two entries with contents from each of the engine running in different cluster instance.
![]() |
Download the project from here
. Contents of the project:
This contains a business process that contains to inbound messaging activities (two receives in succession). These can be fed message through http and contains a 30 seconds wait. After 30 secs, it writes to a file. The default location for the output file is C:\temp. The output file name being bpelClusterExample2_output.txt.
Since there are multiple in-bound messaging activities defined in the business process, message correlation rules need to be specified. The first receive activity initiates the correlation and the second one joins the instance identified by the correlation value. The message content for the receive activities are used to correlate with the instance. Hence,
a) The content of the both the messages should be same
b) If one instance is under execution, another set of request with the same message cannot be processed (or else correlation violation error will result)
![]() |
You can open and build the project in Netbeans to generate the service assembly (SA) or directly download the SA - bpelClusterExample2CompApp.zip
and deploy on the cluster1. We will use command line options to deploy and start the service assembly as there are no configurations involved.
$GLASSFISH_HOME\bin>asadmin deploy-jbi-service-assembly --target cluster1 C:\temp\bpelClusterExample2CompApp.zip
$GLASSFISH_HOME\bin>asadmin start-jbi-service-assembly --target cluster1 bpelClusterExample2CompApp
The Soap UI project to feed messages is included in the Project Zip. The two messages required to complete one instance will be directly fed to different instance of the cluster. Refer the instructions for Example 1 (above) for how to configure Soap UI to update the port to feed message directly to the running instance.
The correlation design uses instance routing (using passivation and activation technique) for managing the correlated messages ending up on different engine. Following screen-shots captures the essence of the design and illustrates the instance routing from one engine to another for processing of the instance. The note along-with the screen-shots provides the insight into correlation processing shows how the instance is handled.
![]() |
![]() |
![]() |
Finally, after successful completion of the test you should see the output file (for the attached project at C:\temp) bpelClusterExample2_output.txt. It will contain the contents (concatenated with single space in between) from each of the message.