Configuring a new queue connection factory for the WebSphere MQ messaging provider by using scripting

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

Before you begin

You can also use the createWMQConnectionFactory command to create a queue connection factory for the WebSphere MQ messaging provider.

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

About this task

Perform the following steps to configure a new queue connection factory 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 MQQueueConnectionFactory
    • Using Jython:
      print AdminConfig.required('MQQueueConnectionFactory')
    Example output:
    attribute  Type
    name				   String
    jndiName			String
  3. Set up the required attributes:
    • Using Jacl:

      set name [list name MQQCF]
      set jndi [list jndiName jms/MQQCF]
      set mqqcfAttrs [list $name $jndi]
      Example output:
      {name MQQCF} {jndiName jms/MQQCF}
    • Using Jython:

      name = ['name', 'MQQCF']
      jndi = ['jndiName', 'jms/MQQCF']
      mqqcfAttrs = [name, jndi]
      print mqqcfAttrs
      Example output:
      [[name, MQQCF], [jndiName, jms/MQQCF]]
  4. Set up a template:
    • Using Jacl:

      set template [lindex [$AdminConfig listTemplates MQQueueConnectionFactory] 0]
    • Using Jython:
      import java
      lineseparator = java.lang.System.getProperty('line.separator')
      template = AdminConfig.listTemplates('MQQueueConnectionFactory').
      split(lineseparator)[0]
      print template 
    Example output:
    Example non-XA WMQ QueueConnectionFactory(templates/
    system:JMS-resource-provider-templates.xml
    #MQQueueConnectionFactory_3)
    
  5. Create a queue connection factory for the WebSphere MQ messaging provider:
    • Using Jacl:

      $AdminConfig createUsingTemplate MQQueueConnectionFactory 
      $newjmsp $mqqcfAttrs $template
    • Using Jython:

      print AdminConfig.createUsingTemplate('MQQueueConnectionFactory', 
      newjmsp, mqqcfAttrs, template)
    Example output:
    MQQCF(cells/mycell/nodes/mynode:resources.xml#MQQueueConnectionFactory_1)
  6. Save the configuration changes.
  7. In a network deployment environment only, synchronize the node.

Example

The following example creates a queue connection factory, specifying custom connection data.

wsadmin>AdminTask.createWMQConnectionFactory('"WebSphere MQ JMS Provider
(cells/EXAMPLECell01|resources.xml#builtin_mqprovider)"', '
[-type QCF -name MQQueueConnectionFactory1 -jndiName 
jms/MQQueueConnectionFactory1 -description -qmgrName 
QueueManagerName -wmqTransportType BINDINGS_THEN_CLIENT 
-qmgrHostname HostName -qmgrSvrconnChannel ServerConnectionChannel ]')

The following example creates a queue connection factory, specifying CCDT connection data.

wsadmin>AdminTask.createWMQConnectionFactory('"WebSphere MQ JMS Provider
(cells/EXAMPLECell01|resources.xml#builtin_mqprovider)"', '
[-type QCF -name MQQueueConnectionFactory2 -jndiName 
jms/MQQueueConnectionFactory2 -description -ccdtUrl 
http://ClientChannelDefinitionTableURL -ccdtQmgrName QueueManager ]') 



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 7:53:43 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=compass&product=was-nd-dist&topic=txml_mqconnection
File name: txml_mqconnection.html