WPS

IBM WebSphere SOA supporting environment available on WebSphere Process Server(WPS). Admnistration of WPS application servers need to handle overloaded the failed events. When the flat files are processed by WPS server there could be chances of getting Failed Events. When WPS processing huge size of flat files, expected Failed Events are more. Most of the QA/Test environment might be filled up with thousands of failed events. That could lead to slowness of the service on WPS. As Middleware administrator you need to clean up these Failed events. 

Automation with Jython scripting for WPS servers administration

How Jython script works for WPS?

The Jython script perform the following steps:

Create a Jython script using text editor (vi/vim) with the file name as DelFailedEvnts.py and enter the code lines as given below:

#======================================================

# This Jython script for removal of WPS Failed Events 

#======================================================

try:

# lookup the failed event manager

objstr = AdminControl.completeObjectName( 'WebSphere:*,type=FailedEventManager')

obj = AdminControl.makeObjectName(objstr)

 

# count the overall number of failed events

fecount = AdminControl.invoke(objstr,"getFailedEventCount")

print "Before discarding failed events", fecount

 

# get failed events

msglist = AdminControl.invoke_jmx(obj,'getAllFailedEvents',[3500],['int'])

 

# discard  events in single batch run

print "Discarding  failed events"

AdminControl.invoke_jmx(obj,'discardFailedEvents',  [msglist],['java.util.List'])

 

# count the overall number of failed events

aftrCnt = AdminControl.invoke(objstr,"getFailedEventCount")

print "After discarding failed events", aftrCnt

except Exception, e:

print "Error", e 

Invoking JYTHON script for WPS/WebSphere

Where should I run this? how should run? don't worry just follow the below commands:

wsadmin.sh -lang jython -f delFailedEvts.py -user <username> -password <password>

 

On Windows platform you can execute the same Jython script.

wsadmin -lang jython -f delFailedEvts.py -user <username> -password <password>

The execution looks like this:

WASX7209I: Connected to process "dmgr" on node  CellManager01 using SOAP connector;  The type of process is: DeploymentManager

WASX7026W: String "WebSphere:*,type=FailedEventManager" corresponds to 2 different MBeans; returning first one.

Before discarding failed events 19243

Discarding  failed events

After discarding failed events 15743

Keep visiting the site we are looking for your valuable comments and suggestions.