modifyWMQConnectionFactory command

Use the modifyWMQConnectionFactory command to change certain parameters of a WebSphere® MQ messaging provider connection factory.

To run the command, use the AdminTask object of the wsadmin scripting client.

This command is valid only when it is used with WebSphere Application Server Version 7 and later application servers. Do not use it with earlier versions.

For a list of the available IBM® MQ messaging provider administrative commands, plus a brief description of each command, enter the following command at the wsadmin prompt:

print AdminTask.help('WMQAdminCommands')

For overview help on a given command, enter the following command at the wsadmin prompt:

print AdminTask.help('command_name')

After using the command, save your changes to the master configuration. For example, use the following command:

AdminConfig.save()

Purpose

Use the modifyWMQConnectionFactory command to modify a WebSphere MQ messaging provider connection factory defined at the scope at which the command is issued.

Note: When modifying a WebSphere MQ messaging provider connection factory, there is an interaction between the mappingAlias and containerAuthAlias parameters. This interaction occurs if the containerAuthAlias parameter is specified but the mappingAlias is not specified. In this situation, the mappingAlias parameter is automatically set to the value DefaultPrincipleMapping.

Target object

A WebSphere MQ messaging provider connection factory at the specific scope.

Required parameters

The parameters for this command are identical to those used to create a WebSphere MQ messaging provider connection factory.

Optional parameters

The parameters for this command are identical to those used to create a WebSphere MQ messaging provider connection factory.

Note: If either the -qmgrHostname or -qmgrPortNumber parameters are specified without the -connectionNameList parameter being specified, then it is assumed that a connection name list should no longer be used to connect to WebSphere MQ and that the specified host name and port number information should be used instead. As a result of this the -connectionNameList parameter is set to blank.

Note the behavior of this command on the -customProperties parameter.

-customProperties
This parameter specifies custom properties to be passed to the WebSphere MQ messaging provider connection factory implementation. Typically, custom properties are used to set attributes of the connection factory that are not directly supported through the WebSphere administration interfaces.
Each custom property is specified using name and value table step parameters. Since these are table steps, the order of the two parameters is fixed, so you must always specify the name first and the value second:
  • In Jython: [name value]
  • In Jacl: {name value}
New name/value pairs are added to the existing set of custom properties using the following rules:
  • If the existing set of properties does not contain a property with the same name as that supplied as part of a modify command, the supplied property is added to the set of custom properties, unless the custom property has no value specified, when it is disregarded.
  • If the existing set of properties contains a property with the same name as that supplied as part of a modify command, and the modify command also specifies a value for the property, the existing value is replaced by the supplied value.
  • If the existing set of properties contains a property with the same name as that supplied as part of a modify command but the modify command does not specify a value for the property, the property with the same name is deleted from the existing set of custom properties.

Example

  • Using Jython:
    wsadmin>AdminConfig.getid("/Node:9994GKCNode01") 
    9994GKCNode01(cells/9994GKCNode01Cell/nodes/9994GKCNode01|node.xml#Node_1)  
    
    wsadmin>AdminTask.listWMQConnectionFactories("9994GKCNode01(cells/
    9994GKCNode01Cell/nodes/9994GKCNode01|node.xml#Node_1)") 
    cf1(cells/9994GKCNode01Cell/nodes/9994GKCNode01|resources.xml#
    MQConnectionFactory_1098737234986)  
    
    wsadmin>AdminTask.modifyWMQConnectionFactory("cf1(cells/9994GKCNode01Cell/
    nodes/9994GKCNode01|resources.xml#MQConnectionFactory_1098737234986)", ["-description
     'My new description'"])  
    cf1(cells/9994GKCNode01Cell/nodes/9994GKCNode01|resources.xml#
    MQConnectionFactory_1098737234986)
  • Using Jacl:
    wsadmin>$AdminConfig getid /Node:9994GKCNode01 
    9994GKCNode01(cells/9994GKCNode01Cell/nodes/9994GKCNode01|node.xml#Node_1)  
    
    wsadmin>$AdminTask listWMQConnectionFactories 
    9994GKCNode01(cells/9994GKCNode01Cell/nodes/9994GKCNode01|node.xml#Node_1) 
    cf1(cells/9994GKCNode01Cell/nodes/9994GKCNode01|resources.xml#
    MQConnectionFactory_1098737234986)  
    
    wsadmin>$AdminTask modifyWMQConnectionFactory 
    cf1(cells/9994GKCNode01Cell/nodes/9994GKCNode01|resources.xml#
    MQConnectionFactory_1098737234986) {-description "My new description"}  
    cf1(cells/9994GKCNode01Cell/nodes/9994GKCNode01|resources.xml#
    MQConnectionFactory_1098737234986)