Work with IBM MQ queue connection factory properties files
Use properties files to create or change IBM MQ queue connection factory properties.
Determine the changes to make to the IBM MQ queue connection factory configuration or its configuration objects.
Start the wsadmin scripting tool...
profile_home/bin/wsadmin -lang Jython
Use a properties file to create, modify, or delete an IBM MQ queue connection factory object and its configuration properties.
Run administrative commands using wsadmin to create or change a properties file for an IBM MQ queue connection factory, validate the properties, and apply them to the configuration.
Action Procedure create Set properties and then run the applyConfigProperties command. modify Edit properties and then run the applyConfigProperties command. delete Uncomment #DELETE=true and run the deleteConfigProperties command. Optionally, we can use interactive mode with the commands:
AdminTask.command_name('-interactive')
Tasks
- Create an IBM MQ queue connection factory and its properties.
- Create a properties file for an MQQueueConnectionFactory object.
Open an editor and create an IBM MQ queue connection factory properties file. We can copy the example properties file in this step into an editor and modify the properties as needed for our situation. The example defines an IBM MQ queue connection factory named myJndiName under a JMSProvider at cell scope:
# # Header # ResourceType=MQQueueConnectionFactory ImplementingResourceType=JMSProvider ResourceId=Cell=!{cellName}:JMSProvider=IBM MQ JMS Provider:MQQueueConnectionFactory=jndiName#myJndiName #DELETE=true # #Properties # wmqServerSvrconnChannel=null diagnoseConnectionUsage=false #boolean,default(false) CCSID=null rcvExit=null wmqServerName=null sslConfiguration=null host=null category=null tempModel=null replyWithRFH2=AS_REPLY_DEST #ENUM(AS_REPLY_DEST|ALWAYS),default(AS_REPLY_DEST) secExit=null name=myName #required xaRecoveryAuthAlias=null description=null useConnectionPooling=true #boolean,default(true) manageCachedHandles=false #boolean,default(false) wmqServerEndpoint=null provider=IBM MQ JMS Provider #ObjectName(JMSProvider),readonly ccdtUrl=null providerVersion=null sslResetCount=0 #integer,default(0) secExitInitData=null pollingInterval=5000 #integer,default(5000) msgRetention=true #boolean,default(true) jndiName= myJndiName #required queueManager=null sendExit=null authMechanismPreference=BASIC_PASSWORD #ENUM(BASIC_PASSWORD|KERBEROS),default(BASIC_PASSWORD) sendExitInitData=null maxBatchSize=10 #integer,default(10) tempQueuePrefix=null XAEnabled=true #boolean,default(true) providerType=null #readonly channel=null rcvExitInitData=null port=0 #integer,default(0) authDataAlias=null sslPeerName=null rescanInterval=6000 #integer,default(5000) compressHeaders=NONE #ENUM(SYSTEM|NONE),default(NONE) failIfQuiesce=true #boolean,default(true) clientID=null localAddress=null sslCRL=null logMissingTransactionContext=true #boolean,default(true) transportType=BINDINGS #ENUM(BINDINGS_THEN_CLIENT|DIRECTHTTP|BINDINGS|DIRECT|CLIENT),default(BINDINGS) sslCipherSuite=null compressPayload=NONE #ENUM(ZLIBHIGH|ZLIBFAST|RLE|NONE),default(NONE) qmgrType=QMGR #ENUM(QSG|QMGR),default(QMGR) sslType=NONE #ENUM(CENTRAL|SPECIFIC|NONE),default(NONE) EnvironmentVariablesSection # # #Environment Variables cellName=WASCell06- Run the applyConfigProperties command to create an IBM MQ queue connection factory configuration.
Running the applyConfigProperties command applies the properties file to the configuration. In this Jython example, the optional -reportFileName parameter produces a report named report.txt:
AdminTask.applyConfigProperties(['-propertiesFileName myObjectType.props -reportFileName report.txt '])
- Modify an existing IBM MQ queue connection factory.
- Obtain a properties file for the IBM MQ queue connection factory to change.
We can extract a properties file for an MQQueueConnectionFactory object using the extractConfigProperties command.
- Open the properties file in an editor and change the properties as needed.
Ensure that the environment variables in the properties file match the system.
- Run the applyConfigProperties command to change an IBM MQ queue connection factory configuration.
- If we no longer need an IBM MQ queue connection factory, we can delete the entire IBM MQ queue connection factory object.
To delete the entire object, specify DELETE=true in the header section of the properties file and run the deleteConfigProperties command; for example:
AdminTask.deleteConfigProperties('[-propertiesFileName myObjectType.props -reportFileName report.txt]')
Use the properties file to configure and manage the IBM MQ queue connection factory object.
What to do next
Save the changes to the configuration.
Extracting properties files Create server, cluster, application, or authorization group objects using properties files and wsadmin scripting Deleting server, cluster, application, or authorization group objects using properties files PropertiesBasedConfiguration .