About Me

About Me
Working with SOA technologies , implementing solution using IBM BPM , IBM Integration Designer,IBM WODM and IBM DataPower

About me

View Mahesh Dondeti's profile on LinkedIn

upcoming posts on IBM Bluemix,Devops,Worklight,Node js.

Tuesday, 18 December 2012

Event sequencing using WebSphere Process Server Configuring and running event sequencing from an MQ queue

Event Sequencing : 
           Event sequencing provides the ability to sequence incoming events to an SCA component in WebSphere Process Server. Export bindings are the entry points to the target SCA components. For event sequencing to be enabled, the exports must process and deliver messages in the same order in which those messages are received.

esAdmin command-line utility

Use the esAdmin command to list, unlock, or delete active and queued locks.
The esAdmin command can list and delete all locks currently managed by the lock manager. When listing locks, you can list all locks or a small subset that is filtered based on the module, component, or method. This command can also be used to release an active lock in a deadlock situation; after the lock is released, it is granted to the next queued request.
If you are using the esAdmin command in a Network Deployment environment, do not run the command on the deployment manager. Instead, run the esAdmin command on one of the managed servers. To use the esAdmin command in a Network Deployment environment, follow these steps:
  1. Verify the name of server on which the application (module) is deployed.
  2. Log in to the administrative console and navigate to Servers > Server Types > WebSphere application servers.
  3. Click the name of the server from step 1 and expand Ports on the right side of the page. Note the SOAP_CONNECTOR_ADDRESS and use this to specify the soapPortNumber.
  4. Run the esAdmin command with the listLocks or listAll method as appropriate

Example

The following command returns a list of active and queued locks for the Order module:
esAdmin listLocks ModuleName
The following command releases lock lockid(ex 1234567). This
command assumes that security is enabled and that the port number
is 9060 (instead of the default 8880).esAdmin -username administrator1 -password adminpassword -p 9060 unlock 1234567  
 
           Use an event sequencing qualifier to ensure that events are processed in the order that a service receives them. Apply the qualifier to the interface operations that you want to include in a sequence. The group identifies which operations will participate in a sequence. The key identifies the value for which the events are sequenced. The qualifier ensures that operations in the same group that have the same key value are processed in the order that they are received.
In Figure 1, you can see that we have loaded an MQ queue with fictitious purchase order (P.O) requests. All the records of the same color must be processed in order, but the purples, blues, and reds can be processed in parallel.  



Event sequencing guarantees that each color is processed in the sequence they are in the queue, while still allowing the other colors to be processed independently(Multiple Threads created when u specify in maximum sessions in MQ listener)  . Without event sequencing, the records are processed serially to keep their order.
Development :

 

Assembly diagram of the event sequencing application 

 



Runtime :


 

                                           Max sessions setting for the listener port 
 Runtime characteristics :
                The messages that need to be processed in a sequence are put into the MQ Ext Queue by the client application. The listener port defined on Process Server is listening on this queue and reads one message at a time from the MQ Ext Queue, sequences it, and then puts it on the SCA Int Event Queue. The messages from the SCA Int Event Queue are being read by Process Server for processing, provided that there is a lock available in the Event Lock table (Figure 5). A lock is applied if there is more than one message with the same sequence ID. If there is a lock on a given sequence ID, then that message is not processed until the lock becomes available. By default, Process Server provides 100 locks to process these sequenced messages. These locks are configurable for the runtime.









What happens on failures :
          Let’s say you have an insert record followed by Update #1 record and Update #2 record that need to be processed for a given sequence ID. If Update #1 fails to process due to some issue (for example, bad data in the message), then you can optionally select during design time to continue with the processing of Update #2, or you can wait until Update #1 has been corrected and processed. This feature is called strict ordering of messages. This feature needs to be appropriately selected at design time in WebSphere Integration Developer. Figure 6 shows this feature.



 
 



The failed transaction will show up in the Failed Event Manager from where you can modify the data and re-submit it for processing.
To see Event Lock table run this in your command prompt "esAdmin -h localhost -p 8880 -username admin -password admin listAll " at  wps bin directory. ( SOAP_CONNECTOR_ADDRESS -- 8880 you can find in listener ports)






Click Here to Download the Application


Click Here to Send Your Feedback