Set a new topic for the WebSphere MQ messaging provider using scripting
Use scripting to configure a new topic for the WebSphere MQ messaging provider.
We can also use the createWMQTopic 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 topic 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 baseTopicName String- Set up the required attributes:
- Jacl...
set name [list name MQT]
set jndi [list jndiName jms/MQT]
set baseTN [list baseTopicName "Put the base topic name here"]
set mqtAttrs [list $name $jndi $baseTN]For example...
{name MQT} {jndiName jms/MQT} {baseTopicName {Put the base topic name here}}- Jython...
name = ['name', 'MQT']
jndi = ['jndiName', 'jms/MQT']
baseTN = ['baseTopicName', "Put the base topic name here"]
mqtAttrs = [name, jndi, baseTN]
print mqtAttrsFor example...
[[name, MQT], [jndiName, jms/MQT], [baseTopicName, "Put the base topic name here"]]
- Create a topic for the WebSphere MQ messaging provider:
- Jacl...
$AdminConfig create MQTopic $newjmsp $mqtAttrs- Jython...
print AdminConfig.create('MQTopic', newjmsp, mqtAttrs)
For example...
MQT(cells/mycell/nodes/mynode|resources.xml#MQTopic_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.createWMQTopic('DRAPERDCell01(cells/DRAPERDCell01|cell.xml)', '[-name MQQueue -jndiName jms/MQQueue -topicName TopicName -qmgr QueueManager -description ]')
Related tasks
Use the AdminConfig object for scripted administration
Related
Commands for the AdminConfig object
createWMQTopic