Configuring a new topic for the WebSphere MQ messaging provider by using scripting

You can use scripting to configure a new topic for the WebSphere® MQ messaging provider.

Before you begin

You can also use the createWMQTopic 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 topic for the WebSphere MQ messaging provider:

Procedure

  1. Identify the parent ID:
    • Using Jacl:

      set newjmsp [$AdminConfig getid /Cell:mycell/Node:mynode/JMSProvider:JMSP1/]
    • Using Jython:
      newjmsp = AdminConfig.getid('/Cell:mycell/Node:myNode/JMSProvider:JMSP1') print newjmsp
    Example output:
    JMSP1(cells/mycell/nodes/mynode|resources.xml#JMSProvider_1)
  2. Get the 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 the 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 a topic for the WebSphere MQ messaging provider:
    • Using Jacl:

      $AdminConfig create MQTopic $newjmsp $mqtAttrs
    • Using Jython:
      print AdminConfig.create('MQTopic', newjmsp, mqtAttrs)
    Example output:
    MQT(cells/mycell/nodes/mynode|resources.xml#MQTopic_1)
  5. Save the configuration changes.

Example

AdminTask.createWMQTopic('DRAPERDCell01(cells/DRAPERDCell01|cell.xml)', '[-name MQQueue 
 -jndiName jms/MQQueue -topicName TopicName -qmgr QueueManager -description ]') 



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    

Terms of Use | Feedback

Last updated: Oct 20, 2010 9:57:58 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=compass&product=was-base-dist&topic=txml_mqtopic
File name: txml_mqtopic.html