Support for administered objects

IBM MQ classes for JMS supports the use of administered objects.

The flow of logic within a JMS application starts with ConnectionFactory and Destination objects. The application uses a ConnectionFactory object to create a Connection object, which represents the active connection from the application to a messaging server. The application uses the Connection object to create a Session object, which is a single threaded context for producing and consuming messages. The application can then use the Session object and a Destination object to create a MessageProducer object, which the application uses to send messages to the specified destination. The destination is either a queue or a topic in the messaging system and is encapsulated by the Destination object. The application can also use the Session object and a Destination object to create a MessageConsumer object, which the application uses to receive messages that have been sent to the specified destination.

The JMS specification expects ConnectionFactory and Destination objects to be administered objects. An administrator creates and maintains administered objects in a central repository, and a JMS application retrieves these objects using the Java Naming Directory Interface (JNDI). The repository of administered objects can range from a simple file to a Lightweight Directory Access Protocol (LDAP) directory.

IBM MQ classes for JMS supports the use of administered objects. An application can use all the features of IBM MQ classes for JMS that are exposed through IBM MQ without having any IBM MQ -specific information hard coded into the application itself. This arrangement provides the application with a degree of independence from the underlying IBM MQ configuration. To achieve this independence, the application can use JNDI to retrieve connection factories and destinations that are stored as administered objects, and use only the interfaces defined in the javax.jms package to perform messaging operations. An administrator can use the IBM MQ JMS administration tool or IBM MQ Explorer to create and maintain administered objects in a central repository. An application server, however, typically provides its own repository for administered objects and its own tools for creating and maintaining the objects. A Java EE application can therefore use JNDI to retrieve administered objects either from the applications server repository or from a central repository.

Parent topic: IBM MQ classes for JMS


Related information