Work with IBM MQ queue properties files
Use properties files to create or change IBM MQ queue properties.
Determine the changes to make to the IBM MQ queue 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 object and its configuration properties.
Run administrative commands using wsadmin to extract a properties file for an IBM MQ queue, validate the properties, and apply them to the configuration.
Action Procedure create Set at least required 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. delete Property To delete one or more properties, run deleteConfigProperties with only those properties to delete in the properties file. Optionally, we can use interactive mode with the commands:
AdminTask.command_name('-interactive')
Tasks
- Create an IBM MQ queue and its properties.
- Create a properties file for an MQQueue object.
Open an editor and create an IBM MQ queue properties file. We can copy the example properties file in this step into an editor and modify the properties as needed for our situation.
An example properties file for an MQQueue object with a name of myName and a JNDI name of myJndiName under a JMSProvider at the cell scope follows:
# # Header # ResourceType=MQQueue ImplementingResourceType=JMSProvider ResourceId=Cell=!{cellName}:JMSProvider=IBM MQ JMS Provider:MQQueue=jndiName#myJndiName # # #Properties # queueManagerPort=0 #integer,default(0) password=null readAhead=YES #ENUM(QUEUE_DEFINED|YES|NO),default(YES) specifiedExpiry=0 #long,default(0) queueManagerHost=null baseQueueName=queueName #required baseQueueManagerName=null providerType=null #readonly decimalEncoding=Normal #ENUM(Normal|Reversed),default(Normal) serverConnectionChannelName=null expiry=APPLICATION_DEFINED #ENUM(APPLICATION_DEFINED|SPECIFIED|UNLIMITED),defaul t(APPLICATION_DEFINED) sendAsync=YES #ENUM(QUEUE_DEFINED|YES|NO),default(YES) userName=null integerEncoding=Normal #ENUM(Normal|Reversed),default(Normal) specifiedPriority=0 #integer,default(0) jndiName=myJndiName#required CCSID=0 #integer,default(0) category=null description=null useNativeEncoding=false #boolean,default(false) boolean=null targetClient=JMS #ENUM(JMS|MQ),default(JMS) priority=APPLICATION_DEFINED #ENUM(APPLICATION_DEFINED|SPECIFIED|QUEUE_DEFINED), default(APPLICATION_DEFINED) persistence=APPLICATION_DEFINED #ENUM(APPLICATION_DEFINED|HIGH|NONPERSISTENT|PERSISTENT|QUEUE_DEFINED),default(APPLICATION_DEFINED) provider=IBM MQ JMS Provider #ObjectName(JMSProvider),readonly floatingPointEncoding=IEEENormal #ENUM(IEEENormal|IEEEReversed|S390),default(IEEENormal) readAheadClose=DELIVERALL #ENUM(DELIVERCURRENT|DELIVERALL),default(DELIVERALL) name=myName #required EnvironmentVariablesSection # # #Environment Variables cellName=WASCell06- Run the applyConfigProperties command to create an MQQueue 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.
- Obtain a properties file for the IBM MQ queue to change.
We can extract a properties file for an MQQueue 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 configuration.
- Delete the entire IBM MQ queue object or its properties.
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]')To delete one or more properties, specify only those properties to delete in the properties file and run deleteConfigProperties.
Use the properties file to configure and manage the IBM MQ queue 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 .