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 queue properties files
We can use properties files to create or change WebSphere MQ queue properties.
Determine the changes to make to your WebSphere MQ queue configuration or its configuration objects.
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 queue object and its configuration properties.
Run administrative commands using wsadmin to extract a properties file for a WebSphere MQ queue, validate the properties, and apply them to the configuration.
Actions for WebSphere MQ queue properties files. We can create, modify, and delete WebSphere MQ queue configuration properties.
Action Procedure create Set at least required properties and then run applyConfigProperties. modify Edit properties and then run the applyConfigProperties command. delete Uncomment #DELETE=true and run deleteConfigProperties. delete Property To delete one or more properties, run deleteConfigProperties with only those properties to delete in the properties file. Optionally, you can use interactive mode with the commands:
AdminTask.command_name('-interactive')
Procedure
- Create a WebSphere MQ queue and its properties.
- Create a properties file for an MQQueue object.
Open an editor and create a WebSphere MQ queue 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 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=WebSphere 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=WebSphere 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 applyConfigProperties to create an MQQueue 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 queue.
- Obtain a properties file for the WebSphere 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 applyConfigProperties to change a WebSphere MQ queue configuration.
- Delete the entire WebSphere MQ queue object or its properties.
To delete the entire object, specify DELETE=true in the header section of the properties file and run deleteConfigProperties; 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.
Results
We can use the properties file to configure and manage the WebSphere MQ queue 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