Set a new queue for the WebSphere MQ messaging provider using scripting
Use scripting to configure a new queue for the WebSphere MQ messaging provider.
We can also use the createWMQQueue to create a queue for the WebSphere MQ messaging provider.
Before starting this task, wsadmin must be running. See the Start wsadmin article for more information.
Perform the following steps to configure a new queue for the WebSphere MQ messaging provider:
- Identify the parent ID:
- Jacl...
set newjmsp [$AdminConfig getid /Cell:mycell/Node:mynode/JMSProvider:JMSP1/]- Jython...
newjmsp = AdminConfig.getid('/Cell:mycell/Node:myNode/JMSProvider:JMSP1') print newjmsp
For example...
JMSP1(cells/mycell/nodes/mynode|resources.xml#JMSProvider_1)- Get the required attributes:
For example...
Attribute Type name String jndiName String baseQueueName String- Set up the required attributes:
- 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]For example...
{name MQQ}
{jndiName jms/MQQ}
{baseQueueName {Put the base queue name here}}
- Jython...
name = ['name', 'MQQ']
jndi = ['jndiName', 'jms/MQQ']
baseQN = ['baseQueueName', "Put the base queue name here"]
mqqAttrs = [name, jndi, baseQN]
print mqqAttrsFor example...
[[name, MQQ], [jndiName, jms/MQQ], [baseQueueName, "Put the base queue name here"]]
- Set up a template:
- Jacl...
set template [lindex [$AdminConfig listTemplates MQQueue] 0]- Jython...
import java
lineseparator = java.lang.System.getProperty('line.separator')
template = AdminConfig.listTemplates('MQQueue').split(lineseparator)[0]
print template
For example...
Example.JMS.WMQ.Q1(templates/system:JMS-resource-provider- templates.xml#MQQueue_1)- Create a queue for the WebSphere MQ messaging provider:
- Jacl...
$AdminConfig createUsingTemplate MQQueue $newjmsp $mqqAttrs $template- Jython...
print AdminConfig.createUsingTemplate('MQQueue', newjmsp, mqqAttrs, template)
For example...
MQQ(cells/mycell/nodes/mynode|resources.xml#MQQueue_1)- Save the configuration changes. See the Saving configuration changes with wsadmin article for more information.
- In a network deployment environment only, synchronize the node. See the Synchronizing nodes with wsadmin article for more information.
Example
AdminTask.createWMQQueue('EXAMPLECell01(cells/EXAMPLECell01|cell.xml)', '[-name MQQueue -jndiName jms/MQQueue -queueName QueueName -qmgr QueueManager -description ]')
Related tasks
Use the AdminConfig object for scripted administration
Related
Commands for the AdminConfig object
createWMQQueue