Configure new MQ topic connection factories using scripting

 

Procedure

  1. Start wsadmin

  2. 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
      

    Example output:

    JMSP1(cells/mycell/nodes/mynode:resources.xml#JMSProvider_1)
    

  3. Get required attributes:

    • Jacl:

      $AdminConfig required MQTopicConnectionFactory
      

    • Jython

      print AdminConfig.required('MQTopicConnectionFactory')
      

    Example output:

    Attribute       Type
    name           String
    jndiName       String
    

  4. Set up required attributes:

    • Jacl:

      set name [list name MQTCF]
      set jndi [list jndiName jms/MQTCF]
      set mqtcfAttrs [list $name $jndi]
      

      Example output:

      {name MQTCF} {jndiName jms/MQTCF}
      

    • Jython

      name = ['name', 'MQTCF']
      jndi = ['jndiName', 'jms/MQTCF']
      mqtcfAttrs = [name, jndi]
      print mqtcfAttrs
      

      Example output:

      [[name, MQTCF], [jndiName, jms/MQTCF]]
      

  5. Set up a template:

    • Jacl:

      set template [lindex [$AdminConfig listTemplates MQTopicConnectionFactory] 0]
      
      

    • Jython

      import java
      lineseparator = java.lang.System.getProperty('line.separator')
      template = AdminConfig.listTemplates('MQTopicConnectionFactory').split(lineseparator)[0]
      print template 
      

    Example output:

    Example non-XA WMQ TopicConnectionFactory(templates/system:
    JMS-resource-provider-templates.xml
    #MQTopicConnectionFactory_5)
    
    

  6. Create mq topic connection factory:

    • Jacl:

      $AdminConfig create MQTopicConnectionFactory $newjmsp $mqtcfAttrs $template
      $AdminConfig save
      

    • Jython

      print AdminConfig.create('MQTopicConnectionFactory', newjmsp, mqtcfAttrs, template)
      

    Example output:

    MQTCF(cells/mycell/nodes/mynode:resources.xml#MQTopicConnectionFactory_1)
    

  7. In a network deployment environment only, synchronize the node.


 

See Also


AdminConfig object for scripted administration

 

See Also


Commands for the AdminConfig object