You can use properties files to create or change WebSphere® MQ queue properties.
Before you begin
Determine the changes that you want to make to your WebSphere MQ queue configuration
or its configuration objects.
Start the wsadmin scripting tool.
To start wsadmin using the Jython language, run the wsadmin
-lang Jython command from the bin directory
of the server profile.
About this task
Using 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 your configuration.
Table 1. Actions for WebSphere MQ queue properties files. You can create, modify, and delete WebSphere MQ queue configuration properties.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, 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 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 WebSphere MQ
queue.
- Obtain a properties file for the WebSphere MQ queue that you want to change.
You 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 your system.
- Run the applyConfigProperties command 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 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.
Results
You can use the properties file to configure and manage
the WebSphere MQ queue
object.
What to do next
Save the changes to your configuration.