+

Search Tips   |   Advanced Search

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:

 

  1. 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)
  2. Get the required attributes:

    • Jacl...

      $AdminConfig required MQTopic
    • Jython...

      print AdminConfig.required('MQTopic')

    For example...

    Attribute Type name String jndiName String baseTopicName String
  3. 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 mqtAttrs

      For example...

      [[name, MQT], [jndiName, jms/MQT], [baseTopicName, "Put the base topic name here"]]

  4. 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)
  5. Save the configuration changes. See the Saving configuration changes with wsadmin article for more information.
  6. 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