The Java Message Service (JMS) API uses two kinds of administered objects:
These objects must be created administratively, and how they are created is specific to each implementation of JMS. In the Application Server, perform the following tasks:
A JMS application normally uses at least one connection factory and at least one destination. It is best to understand the application or consult with the application developer to learn what resources to create.
There are three types of connection factories:
QueueConnectionFactory
objects, used for point-to-point communicationTopicConnectionFactory
objects, used for publish-subscribe communicationConnectionFactory
objects, which can be used for both point-to-point and publish-subscribe communications; these are recommended for new applicationsThere are two kinds of destinations:
Queue
objects, used for point-to-point communicationTopic
objects, used for publish-subscribe communication
The chapters on JMS in the J2EE 1.4 Tutorial provide details on these two types of communication and other aspects of JMS (see http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html
).
The order in which the resources are created does not matter.
For a J2EE application, specify connection factory and destination resources in the Application Server deployment descriptors as follows:
resource-ref
or an mdb-connection-factory
element. ejb
element for a message-driven bean and in the message-destination
element.message-destination-link
element, within either a message-driven
element of an enterprise bean deployment descriptor or a message-destination-ref
element. In addition, specify it in the message-destination
element. (The message-destination-ref
element replaces the resource-env-ref
element, which is deprecated in new applications.) In the message-destination
element of an Application Server deployment descriptor, link the physical destination name with the destination resource name.See Also: