Bootstrap FreeKB - IBM WebSphere - Update Connection Factory using wsadmin
IBM WebSphere - Update Connection Factory using wsadmin

Updated:   |  IBM WebSphere articles

If you are not familiar with wsadmin.sh (Linux) / wsadmin.bat (Windows), check out my article Getting Started with wsadmin.

A Connection Factory is typically scoped to a cell, node, cluster, or application server. For example, let's say there are Connection Factories scoped to a cluster. In this scenario, you will first want to use the wsdamin command to get the ID of the cluster

The following wsadmin command can be used to get the name and ID the clusters in your cell using jython.

~]$ /opt/WebSphere/AppServer/profiles/your_profile/bin/wsadmin.sh -lang jython -c "print AdminClusterManagement.listClusters()"
WASX7209I: Connected to process "dmgr" on node your_node using SOAP connector;  The type of process is: DeploymentManager
---------------------------------------------------------------
 AdminClusterManagement: List server clusters
 Usage: AdminClusterManagement.listClusters()
 Return: List of the clusters in the cell.
---------------------------------------------------------------
 
cluster is found: myCluster(cells/your_cell/clusters/myCluster|cluster.xml#ServerCluster_1404931637566
['myCluster(cells/your_cell/clusters/myCluster|cluster.xml#ServerCluster_1404931637566']

 

Using the cluster ID, you can then use listWMQConnectionFactories to list the Connection Factories in the cluster. In this example, there is one Connection Factory named foo scoped to myCluster.

AdminTask.listWMQConnectionFactories('myCluster(cells/your_cell/clusters/myCluster|cluster.xml#ServerCluster_1404931637566)')

 

Which should return something like this.

foo(cells/your_cell/clusters/myCluster|resources.xml#MQConnectionFactory_1512498549419)

 

And then use showWMQConnectionFactory to display the details of a Connection Factory.

AdminTask.showWMQConnectionFactory('foo(cells/your_cell/clusters/your_cluster|resources.xml#MQConnectionFactory_1512498549419)')

 

Which should return something like this.

{
 clientReconnectOptions=DISABLED,
 msgRetention=YES,
 pubSubCleanup=SAFE,
 failIfQuiesce=true,
 pubSubCleanupInterval=3600000,
 substore=MIGRATE,
 pollingInterval=5000,
 xaRecoveryAuthAlias=john.doe,
 connectionNameList=null,
 mappingAlias=DefaultPrincipalMapping,
 tempTopicPrefix=null,
 qmgrHostname=mq1.example.com,
 sendExit=null,
 containerAuthAlias=null,
 compressHeaders=NONE,
 tempQueuePrefix=null,
 wildcardFormat=topicWildcards,
 msgSelection=CLIENT,
 sslType=SPECIFIC,
 qmgrName=MANAGER01,
 sslPeerName=null,
 componentAuthAlias=null,
 clientReconnectTimeout=1800,
 brokerVersion=MA0C,
 clonedSubs=false,
 sslConfiguration=MQSSL,
 rcvExit=null,
 localAddress=null,
 name=DirectToMember,
 brokerCtrlQueue=SYSTEM.BROKER.CONTROL.QUEUE,
 providerVersion=null,
 brokerPubQueue=SYSTEM.BROKER.DEFAULT.STREAM,
 tempModel=SYSTEM.DEFAULT.MODEL.QUEUE,
 support2PCProtocol=true,
 description=foo,
 brokerQueueManager=null,
 jndiName=jms/mq/conn/foo,
 secExitInitData=null,
 ccsid=819,
 sslResetCount=0,
 secExit=null,
 brokerSubQueue=SYSTEM.JMS.ND.SUBSCRIBER.QUEUE,
 sendExitInitData=null,
 rescanInterval=5000,
 compressPayload=NONE,
 statRefreshInterval=60000,
 brokerCCSubQueue=SYSTEM.JMS.ND.CC.SUBSCRIBER.QUEUE,
 sparseSubscriptions=false,
 clientId=null,
 qmgrPortNumber=5203,
 pubAckInterval=25,
 wmqTransportType=CLIENT,
 qmgrSvrconnChannel=CHANNEL01,
 rcvExitInitData=null,
 sslCrl=null,
 replyWithRFH2=AS_REPLY_DEST,
 qmgrType=QMGR
}

 

And then use modifyWMQConnectionFactory to update the Connection Factory. In this example, the Connection Factory description will be updated from "foo" to "bar".

AdminTask.modifyWMQConnectionFactory('foo(cells/your_cell/clusters/your_cluster|resources.xml#MQConnectionFactory_1512498549419)', ['-description bar'] )

 

And then save the change.

AdminConfig.save()

 

The Connection Factory should also be in the ${WAS_INSTALL_ROOT}/profiles/your_profile/config/cells/your_cell/nodes/your_node/resources.xml file on the server.




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter d3d416 in the box below so that we can be sure you are a human.