Index Changes

Practical Guide for testing Clustering Support (Including Business Processes with Correlation) for BPEL Service Engine.

Overview


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


Sample Project #1 (For Cluster and Failover testing)


Download the project from here . Contents of the project:

  1. BPEL Project - BpelClusterExample1
  2. Composite Application Project - bpelClusterExample1CompApp
  3. Soap UI Project - ClusterExample1-instance-ONE-soapui-project (for feeding message to instance-ONE)
  4. Soap UI Project - ClusterExample1-instance-ONE-soapui-project (for feeding message to instance-TWO)

Project Description


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.

Installing File BC


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.

Deploying the project


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

Test Client Setup


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.

Running the project


Note: The following discussion assumes that you will not be using the HTTP Load Balancer. Instead, the messages will be sent directly to the two instances. In case, you want to use the HTTP Load Balancer then you will need to substitute the steps appropriately. Refer to the section Glassfish Cluster Installation above for instructions to set up the HTTP Load Balancer.

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.

Failover Support Test


  • In the attached SOAP UI Project expand the TestSuite and open the LoadTest1. This is configured to feed 10 messages. Run the same for each project.
  • Verify that in the STATE table there are 20 instances (with status as RUNNING)
  • Wait 30 Seconds, check the output file. You should see 20 entries with 10 entries from each instance.
  • Delete the output file. (You can also delete all the records in the state table)
  • Feed 10 messages to each instance again. Verify from STATE table that there are 20 instance and are equally distributed among the engines (check engineid for the instances).
  • Shutdown cluster instance instance-ONE. You can use the following command to shutdown the instance
$GLASSFISH_HOME\bin>asadmin stop-instance instance-ONE
Command stop-instance executed successfully.
  • The shutdown of the instance-ONE will result in the running instances of instance-ONE failing over to instance-TWO, which will complete the instance.
  • Verify the output file for 20 entries for all the input for each instance. Also, check the state table to see the 20 instance in complete state. Notice also that all the 20 instance now has engineid as instance-TWO indicating that all the instance were failed over to this live instance.

Sample Project #2 (For Correlation Support testing)


Download the project from here . Contents of the project:

  1. BPEL Project - bpelClusterExample2
  2. Composite Application Project - bpelClusterExample2CompApp
  3. Soap UI Project - ClusterExample2-soapui-project

Project Description


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)

Deploying the project


NOTE: This project uses File BC for writing to file system. Please install file bc prior to deployment of the project. Refer instructions under Example 1 for File BC installation.

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

Test Client Setup


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.

Testing Correlation Support on Cluster


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.

BPEL SE Cluster Example

Contact


Malkit Singh Bhasin
malkit.bhasin@sun.com
bpelengine-dev@sun.com

JSPWiki v2.4.100
[RSS]
« Home Index Changes Prefs
This page (revision-82) was last changed on 16-Mar-09 10:28 AM, -0700 by Murali