Configuring connection factories and destinations in a JNDI namespace
JMS and Jakarta Messaging applications access administered objects in the naming and directory service through the Java Naming and Directory Interface (JNDI). The JMS or Jakarta Messaging administered objects are stored in a location within the naming and directory service that is referred to as the JNDI namespace. A JMS or Jakarta Messaging application can look up the administered objects to connect to IBM® MQ and access destinations for sending or receiving messages.
About this task
- Initial context
- The initial context defines the root of the JNDI namespace. For each location in the naming and directory service, you need to specify an initial context to give a starting point from which a JMS or Jakarta Messaging application can resolve the names of the administered objects in that location of the naming and directory service.
- Subcontexts
- A context can have one or more subcontexts. A subcontext is a subdivision of a JNDI namespace and can contain administered objects such as connection factories and destinations as well as other subcontexts. A subcontext is not an object in its own right; it is merely an extension of the naming convention for the objects in the subcontext.
- Connection factory
- A JMS or Jakarta Messaging connection factory object defines a set of standard configuration properties for connections. A JMS or Jakarta Messaging application uses a connection factory to create a connection to IBM MQ. You can create a connection factory that is specific to one of the two messaging domains, the point-to-point messaging domain and the publish/subscribe messaging domain.
- Destination
- A JMS or Jakarta Messaging destination is an object that represents the target of
messages that the client produces and the source of messages that a JMS application consumes. The JMSor Jakarta Messaging
application can either use a single destination object to put messages on and to get messages from,
or the application can use separate destination objects. There are two types of destination
object:
- JMS or Jakarta Messaging queue destination used in point-to-point messaging
- JMS or Jakarta Messaging topic destination used in publish/subscribe messaging
For JMS 2.0, you can create contexts and administered objects by using either IBM MQ Explorer or the IBM MQ JMS administration tool JMSAdmin.
If you use JMS messaging between WebSphere® Application Server and IBM MQ, you must create corresponding objects in WebSphere Application Server to use to communicate with IBM MQ. When you create one of these objects in WebSphere Application Server, it is stored in the WebSphere Application Server JNDI namespace as shown in the following diagram.
Although IBM MQ 9.3 and later support Jakarta Messaging 3.0, WebSphere Application Server does not currently have equivalent support. Therefore, in WebSphere Application Server, you configure Java Message Service 2.0 resources.
If your application uses a message-driven bean (MDB), the connection factory is used for outbound messages only and inbound messages are received by an activation specification. Activation specifications are part of the Java EE Connector Architecture 1.5 (JCA 1.5) standard. JCA 1.5 provides a standard way to integrate JMS providers, such as IBM MQ, with Java EE application servers such as WebSphere Application Server. A JMS activation specification can be associated with one or more message driven beans (MDBs) and provides the configuration necessary for these MDBs to listen for messages arriving at a destination.
You can use either the WebSphere Application Server administrative console or wsadmin scripting commands to create and configure the JMS resources that you need.
Procedure
- To configure JMS objects for IBM MQ by using IBM MQ Explorer, see Configuring JMS 2.0 objects using IBM MQ Explorer.
- To configure JMS objects for IBM MQ by using the IBM MQ JMS administration tool, JMSAdmin, see Configuring JMS and Jakarta Messaging objects using the administration tools.
- To configure Jakarta Messaging objects for IBM MQ by using the IBM MQ Jakarta Messaging administration tool, JMS30Admin, see Configuring JMS and Jakarta Messaging objects using the administration tools.
- To configure JMS objects for WebSphere Application Server, see Configuring JMS 2.0 resources in WebSphere Application Server.
Results
An IBM MQ classes for JMS or IBM MQ classes for Jakarta Messaging application can retrieve the administered objects from the JNDI namespace and, if required, set or change one or more of its properties by using either the IBM JMS extensions or the IBM MQ JMS extensions.