+

Search Tips   |   Advanced Search

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


Use scripting to configure a new queue connection factory for the WebSphere MQ messaging provider.

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

Before starting this task, wsadmin must be running. See the Start wsadmin article for more information.

Perform the following steps to configure a new queue connection factory for the WebSphere MQ messaging provider:

 

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

    For example...

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

  2. Get the required attributes:

    • Jacl...

      $AdminConfig required MQQueueConnectionFactory
    • Jython...

      print AdminConfig.required('MQQueueConnectionFactory')

    For example...

    attribute Type name String jndiName String

  3. Set up the required attributes:

    • Jacl...

      set name [list name MQQCF]
      set jndi [list jndiName jms/MQQCF]
      set mqqcfAttrs [list $name $jndi]

      For example...

      {name MQQCF} {jndiName jms/MQQCF}
    • Jython...

      name = ['name', 'MQQCF']
      jndi = ['jndiName', 'jms/MQQCF']
      mqqcfAttrs = [name, jndi] print mqqcfAttrs

      For example...

      [[name, MQQCF], [jndiName, jms/MQQCF]]

  4. Set up a template:

    • Jacl...

      set template [lindex [$AdminConfig listTemplates MQQueueConnectionFactory] 0]
    • Jython...

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

    For example...

    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:

    • Jacl...

      $AdminConfig createUsingTemplate MQQueueConnectionFactory $newjmsp $mqqcfAttrs $template
    • Jython...

      print AdminConfig.createUsingTemplate('MQQueueConnectionFactory', newjmsp, mqqcfAttrs, template)

    For example...

    MQQCF(cells/mycell/nodes/mynode:resources.xml#MQQueueConnectionFactory_1)

  6. Save the configuration changes. See the Saving configuration changes with wsadmin article for more information.

  7. In a network deployment environment only, synchronize the node. See the Synchronizing nodes with wsadmin article for more information.

 

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 ]')

 

Related tasks


Use the AdminConfig object for scripted administration

 

Related


Commands for the AdminConfig object
createWMQConnectionFactory