Network Deployment (Distributed operating systems), v8.0 > Scripting the application serving environment (wsadmin) > Use properties files to manage system configuration > Manage specific configuration objects using properties files > Work with JMS provider properties files
Work with WebSphere MQ topic properties files
We can use properties files to create or change WebSphere MQ topic properties.
Determine the changes to make to your WebSphere MQ topic configuration.
Start wsadmin.sh.
To start wsadmin using the Jython language, run the wsadmin -lang Jython command from the bin directory of the server profile.
Use a properties file, you can create, modify, or delete a WebSphere MQ topic object and its configuration properties.
Run administrative commands using wsadmin to create or change a properties file for a WebSphere MQ topic, validate the properties, and apply them to the configuration.
Actions for WebSphere MQ topic properties files. We can create, modify, and delete WebSphere MQ topic configuration properties.
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 deleteConfigProperties. Optionally, you can use interactive mode with the commands:
AdminTask.command_name('-interactive')
Procedure
- Create a WebSphere MQ topic and its properties.
- Create a properties file for an MQTopic object.
Open an editor and create an MQ topic properties file. You can copy the example properties file in this step into an editor and modify the properties as needed for your situation.
An example properties file for an MQTopic object with a JNDI name of topicJndiName under a JMSProvider named WebSphere MQ JMS Provider at the cell scope follows:
# # Header # ResourceType=MQTopic ImplementingResourceType=GenericType ResourceId=Cell=!{cellName}:JMSProvider=WebSphere 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=WebSphere 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 applyConfigProperties to create an MQTopic configuration.
Run 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 WebSphere MQ topic.
- Obtain a properties file for the WebSphere 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 applyConfigProperties to change a WebSphere MQ topic configuration.
- If you no longer need a WebSphere MQ topic, you can delete the entire WebSphere 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]')
Results
We can use the properties file to configure and manage the WebSphere MQ topic object.
What to do next
Save the changes to the configuration.
Extract properties files using wsadmin.sh
Create server, cluster, application, or authorization group objects using properties files and wsadmin scripting
Delete server, cluster, application, or authorization group objects using properties files
Related
PropertiesBasedConfiguration command group using wsadmin.sh