Creating a connection factory

A JMS client (a Java application that uses the JMS API) uses connection factories to create connections to the JMS provider (a messaging provider such as IBM® MQ).

About this task

When you define a connection factory, you select the messaging provider that is to be used as the JMS provider. If you want to change the JMS provider, you must create a new connection factory for the new JMS provider.

The initial context for the JNDI namespace in which you want to create the connection factory must be displayed in the JMS Administered Objects folder and must be connected to IBM MQ Explorer.

To create a connection factory object, complete the following steps.

Procedure

  1. In the Navigator view, expand the JMS Administered Objects folder, then expand the initial context (and subcontexts, if necessary) for the JNDI namespace in which the connection factory will be stored.
  2. Right-click the Connection Factories folder, then click New > Connection Factory.... The New Connection Factory wizard opens.
  3. In the wizard, type a name for the connection factory and select the messaging provider to which the JMS client will use the connection factory to connect, then click Next:
    • If you are using point-to-point messaging or if you are using the IBM MQ Publish/Subscribe broker, click IBM MQ.
  4. Select the type of connection factory that you want to create:
    • Click Connection Factory if the JMS application will use both point-to-point messaging and publish/subscribe messaging, especially if you want the JMS application to perform both types of messaging under the same transaction.
    • Click Queue Connection Factory if the JMS application will use only point-to-point messaging.
    • Click Topic Connection Factory if the JMS application will use only publish/subscribe messaging.
  5. Optional: To support XA transactions, select the Support XA transactions check box. XA transactions are not supported if you are using Real-time as the messaging provider.
  6. Click Next.
  7. Select the type of transport that will be used by the connections that are created by the connection factory, then click Next:
    • If the JMS client that uses the connection factory is on a different computer from the queue manager, click MQ Client. This means that the connection uses TCP/IP. If you select MQ Client and you selected the Support XA transactions check box on the previous page of the wizard, you must install the Java Extended Transaction Support component of IBM MQ.
    • If the JMS application using the connection factory runs on the same computer as the queue manager, you can click MQ Client (see the previous option for more information) or you can click Bindings, which means that the JMS client connects directly to the queue manager.
    • If the JMS client that uses the connection factory will connect to the Real-time broker using TCP/IP, click Direct.
    • If the JMS client that uses the connection factory will connect to the Real-time broker using HTTP tunneling, click Direct HTTP.
      Note: Real-time transport is not available in IBM MQ 8.0. If you are using IBM MQ 8.0 you can define Real-time transport, but it fails when an attempt is made to create a connection.
  8. Optional: If you want to create the connection factory object with the same attributes as an existing connection factory, select the Create with attributes like an existing JNDI object, then click Select to select the existing connection factory.
  9. Click Finish.

Results

The new connection factory is displayed in the Content view of the Connection Factories folder.