Work with IBM MQ topic properties files
Use properties files to create or change IBM MQ topic properties.
Determine the changes to make to the IBM MQ topic configuration.
Start the wsadmin scripting tool...
profile_home/bin/wsadmin -lang Jython
Use a properties file to create, modify, or delete an IBM MQ topic object and its configuration properties.
Run administrative commands using wsadmin to create or change a properties file for an IBM MQ topic, 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 topic and its properties.
- Create a properties file for an MQTopic object.
Open an editor and create an MQ topic 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 MQTopic object with a JNDI name of topicJndiName under a JMSProvider named IBM MQ JMS Provider at the cell scope follows:
# # Header # ResourceType=MQTopic ImplementingResourceType=GenericType ResourceId=Cell=!{cellName}:JMSProvider=IBM MQ JMS Provider:MQTopic=jndiName#topicJndiName #DELETE=true # #Properties # wildcardFormat=topicWildcards #ENUM(characterWildcards|allWildcards|topicWildcards),default(topicWildcards) readAhead=YES #ENUM(QUEUE_DEFINED|YES|NO),default(YES) specifiedExpiry=0 #long,default(0) baseTopicName=topicBaseTopicName #required brokerPubQmgr=null providerType=null #readonly decimalEncoding=Normal #ENUM(Normal|Reversed),default(Normal) expiry=APPLICATION_DEFINED #ENUM(APPLICATION_DEFINED|SPECIFIED|UNLIMITED),default(APPLICATION_DEFINED) sendAsync=YES #ENUM(QUEUE_DEFINED|YES|NO),default(YES) integerEncoding=Normal #ENUM(Normal|Reversed),default(Normal) brokerPubQueue=null specifiedPriority=0 #integer,default(0) jndiName=topicJndiName #required CCSID=0 #integer,default(0) category=null description=null brokerVersion=V1 #ENUM(V2|V1),default(V1) brokerCCDurSubQueue=null brokerDurSubQueue=null boolean=null targetClient=JMS #ENUM(JMS|MQ),default(JMS) priority=APPLICATION_DEFINED #ENUM(APPLICATION_DEFINED|SPECIFIED|QUEUE_DEFINED),default(APPLICATION_DEFINED) provider=IBM MQ JMS Provider #ObjectName(JMSProvider),readonly persistence=APPLICATION_DEFINED #ENUM(APPLICATION_DEFINED|HIGH|NONPERSISTENT|PERSISTENT|QUEUE_DEFINED),default(APPLICATION_DEFINED) floatingPointEncoding=IEEENormal #ENUM(IEEENormal|IEEEReversed|S390),default(IEEENormal) readAheadClose=DELIVERALL #ENUM(DELIVERCURRENT|DELIVERALL),default(DELIVERALL) multicast=AS_CF #ENUM(AS_CF|DISABLED|NOT_RELIABLE|RELIABLE|ENABLED),default(AS_CF) name=topicName #required EnvironmentVariablesSection # # #Environment Variables cellName=WASCell06- Run the applyConfigProperties command to create an MQTopic 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 topic.
- Obtain a properties file for the IBM MQ topic to change.
We can extract a properties file for an MQTopic 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 topic configuration.
- If we no longer need an IBM MQ topic, we can delete the entire IBM MQ topic 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 topic 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 .