Date Created: Sun 13-Mar-2011

Related Document Categories:


    How to disable WMQ in WebSphere 8 using manageWMQ command with Jython



    #Get cell name
    cellName = AdminControl.getCell()
    print cellName
    nodeName = AdminControl.getNode()
    print nodeName
    serverName="server01"
    print serverName
    #Get List of J2C Resource Adapters
    ras = AdminUtilities.convertToList(AdminConfig.list('J2CResourceAdapter'))

    #Iterate through [Built In WebSphere MQ Resource Adapter]s and find server01, then set MQ as disabled
    for ra in ras :
    desc = AdminConfig.showAttribute(ra, "description")
    #print "J2CResource Adapter: " + ra
    #print desc
    #decr will contain one of the follwing to when no service pack is applied
    #WAS 7.0 Built In WebSphere MQ Resource Adapter
    #WAS 7.0.0.1 Built In WebSphere MQ Resource Adapter
    #if (desc == "WAS 7.0 Built In WebSphere MQ Resource Adapter") or (desc == "WAS 7.0.0.1 Built In WebSphere MQ Resource Adapter"):
    #print desc.find("Built In WebSphere MQ Resource Adapter")
    if desc.find("Built In WebSphere MQ Resource Adapter") > 0:
    #print "Match found"
    if ra.find(serverName) > 0:
    #print serverName + ": found in adapter list"
    AdminTask.manageWMQ(ra, '[-nativePath -disableWMQ true ]')
    AdminConfig.save()
    print "WMQ has been disabled for server01"
    #end if
    #end if
    #end for

Middleware Mentor - Steven Charles Robinson

About Me

Steve Robinson has been working in IT for over 15 years and has provided solutions for many large-enterprise corporate companies across the world. Steve specialises in Java and Middleware consulting. Steve comes from both an administration and development background.

Before moving to JEE, Steve was an accomplished developer and consultant for both IBM Lotus Notes and Microsoft .NET Technologies.

Follow Steve as @stevencrobinson on twitter.

Read my books?

IBM WebSphere Application Server 8.0 Administration Guide

IBM WebSphere Application Server 8.0 Administration Guide

WebSphere Application Server 7.0 Administration Guide

WebSphere Application Server 7.0 Administration Guide

WebSphere Categories

Oracle WebLogic Categories

JBoss Categories

Other Categories