Configuring new WebSphere topics by using scripting

You can configure new WebSphere topics by using the wsadmin tool and scripting.

Before you begin

Before starting this task, the wsadmin tool must be running.

About this task

Complete the following steps to configure a new WebSphere topic:

Note: In the following examples, code blocks beginning with wsadmin> show code that is entered by the user. Lines that do not begin with wsadmin> show code that has been returned by the console.

Procedure

  1. Identify the parent ID and assign in to a variable. In this example the variable is named v5jmsp.
    • Using Jacl:
      wsadmin>set v5jmsp [$AdminConfig getid "/Cell:mycell/Node:mynode/JMSProvider:WebSphere JMS Provider/"]
    • Using Jython:
      wsadmin>v5jmsp = AdminConfig.getid("/Cell:mycell/Node:myNode/JMSProvider:WebSphere JMS Provider/") 
      wsadmin>print v5jmsp
    Example output:
    "WebSphere JMS Provider(cells/mycell/nodes/mynode|resources.xml#builtin_jmsprovider)"
  2. Get required attributes:
    • Using Jacl:
      wsadmin>$AdminConfig required WASTopic
    • Using Jython:
      wsadmin>print AdminConfig.required('WASTopic')
    Example output:
    Attribute       Type
    name				   String
    jndiName			 String
    topic		      String
  3. Set up required attributes:
    • Using Jacl:
      wsadmin>set name [list name WAST1]
      wsadmin>set jndi [list jndiName jms/WAST1]
      wsadmin>set topic [list topic "Put your topic here"]
      wsadmin>set wtAttrs [list $name $jndi $topic]
      Example output:
      {name WAST1} {jndiName jms/WAST1} {topic {Put your topic here}}
    • Using Jython:
      wsadmin>name = ['name', 'WAST1']
      wsadmin>jndi = ['jndiName', 'jms/WAST1']
      wsadmin>topic = ['topic', "Put your topic here"]
      wsadmin>wtAttrs = [name, jndi, topic]
      wsadmin>print wtAttrs

      Example output:
      [[name, WAST1], [jndiName, jms/WAST1], [topic, "Put your topic here"]]
  4. Create the topic:
    • Using Jacl:
      wsadmin>$AdminConfig create WASTopic $v5jmsp $wtAttrs
    • Using Jython:
      wsadmin>print AdminConfig.create('WASTopic', v5jmsp, wtAttrs)
    Example output:
    WAST1(cells/mycell/nodes/mynode|resources.xml#WASTopic_1)
  5. Save the configuration changes.
  6. In a network deployment environment only, synchronize the node.



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: Feb 5, 2014 9:49:51 PM CST
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=compass&product=was-nd-mp&topic=txml_wastopic
File name: txml_wastopic.html