Configuring new MQ topics using scripting

You can use scripting to configure a new MQ topic.

Before you begin

Before starting this task, the wsadmin tool must be running. See the Starting the wsadmin scripting client article for more information.

About this task

Perform the following steps to configure a new MQ topic:

Procedure

  1. Identify the parent ID:
    • Using Jacl:

      set mqjmsp [$AdminConfig getid "/Cell:mycell/Node:mynode/JMSProvider:WebSphere MQ JMS Provider/"]
    • Using Jython:
      mqjmsp = AdminConfig.getid('/Cell:mycell/Node:myNode/JMSProvider:WebSphere MQ JMS Provider') 
      print mqjmsp
    Example output:
    "WebSphere MQ JMS Provider(cells/mycell/nodes/mynode|resources.xml#builtin_mqprovider)"
  2. Get required attributes:
    • Using Jacl:

      $AdminConfig required MQTopic
    • Using Jython:
      print AdminConfig.required('MQTopic')
    Example output:
    Attribute            Type
    name                 String
    jndiName             String
    baseTopicName        String
  3. Set up required attributes:
    • Using 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]
      Example output:
      {name MQT} {jndiName jms/MQT} {baseTopicName {Put the base topic name here}}
    • Using Jython:
      name = ['name', 'MQT']
      jndi = ['jndiName', 'jms/MQT']
      baseTN = ['baseTopicName', "Put the base topic name here"]
      mqtAttrs = [name, jndi, baseTN]
      print mqtAttrs
      Example output:
      [[name, MQT], [jndiName, jms/MQT], [baseTopicName, "Put the base topic name here"]]
  4. Create MQ topic factory:
    • Using Jacl:

      $AdminConfig create MQTopic $mqjmsp $mqtAttrs
    • Using Jython:
      print AdminConfig.create('MQTopic', mqjmsp, mqtAttrs)
    Example output:
    MQT(cells/mycell/nodes/mynode|resources.xml#MQTopic_1)
  5. Save the configuration changes. See the Saving configuration changes with the wsadmin tool article for more information.
  6. In a network deployment environment only, synchronize the node. See the Synchronizing nodes with the wsadmin tool article for more information.



In this information ...


IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic Task topic    

Terms and conditions for information centers | Feedback

Last updatedLast updated: Aug 31, 2013 12:02:36 AM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=pix&product=was-nd-zos&topic=txml_mqtopic
File name: txml_mqtopic.html