You can use scripting to configure a new queue for the WebSphere® MQ
messaging provider.
Before you begin
You can also use the
createWMQQueue command to
create a queue for the WebSphere MQ messaging provider.
Before starting
this task, the wsadmin tool must be running.
About this task
Complete the following steps to configure a new queue for the WebSphere MQ
messaging provider:
Procedure
- Identify the parent ID:
Example output:
JMSP1(cells/mycell/nodes/mynode|resources.xml#JMSProvider_1)
- Get the required attributes:
Example output:
Attribute Type name String jndiName String baseQueueName String
- Set up the required attributes:
Using Jacl:
set name [list name MQQ] set jndi [list jndiName jms/MQQ] set baseQN [list baseQueueName "Put the
base queue name here"] set mqqAttrs [list $name $jndi $baseQN]
Example
output:
{name MQQ} {jndiName jms/MQQ} {baseQueueName {Put the base queue name here}}
Using Jython:
name = ['name', 'MQQ'] jndi = ['jndiName', 'jms/MQQ'] baseQN = ['baseQueueName', "Put the base
queue name here"] mqqAttrs = [name, jndi, baseQN] print mqqAttrs
Example
output:
[[name, MQQ], [jndiName, jms/MQQ], [baseQueueName, "Put the base queue name here"]]
- Set up a template:
Using Jacl:
set template [lindex [$AdminConfig listTemplates MQQueue] 0]
Using Jython:
import java lineseparator = java.lang.System.getProperty('line.separator') template =
AdminConfig.listTemplates('MQQueue').split(lineseparator)[0] print template
Example output:
Example.JMS.WMQ.Q1(templates/system:JMS-resource-provider- templates.xml#MQQueue_1)
- Create a queue for the WebSphere MQ messaging provider:
Using Jacl:
$AdminConfig createUsingTemplate MQQueue $newjmsp $mqqAttrs $template
Using Jython:
print AdminConfig.createUsingTemplate('MQQueue', newjmsp, mqqAttrs, template)
Example output:
MQQ(cells/mycell/nodes/mynode|resources.xml#MQQueue_1)
- Save the configuration changes.
Example
AdminTask.createWMQQueue('EXAMPLECell01(cells/EXAMPLECell01|cell.xml)', '[-name MQQueue
-jndiName jms/MQQueue -queueName QueueName -qmgr QueueManager -description ]')