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
- 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.
- Right-click the Connection Factories folder,
then click . The New Connection Factory wizard
opens.
- 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.
- 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.
- 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.
- Click Next.
- Select the type of transport that will be used by the connections
that are created by the connection factory, then click Next:
- 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.
- Click Finish.
Results
The new connection factory is displayed in the Content
view of the Connection Factories folder.