[ Team LiB ] Previous Section Next Section

Brief Introduction to JMS

The Java Message Service (JMS) is a Java API that defines how messaging clients can interface with underlying messaging service providers in a standard fashion. JMS also provides an interface that underlying messaging service providers implement to provide JMS services to clients. Thus, JMS follows the familiar model of providing both an application programmer interface and a service-provider interface to implement standard services akin to the model followed by JDBC, JNDI, and many other Java enterprise component interfaces.

JMS provides both a point-to-point and a publish-subscribe model of messaging. Such messaging models are also referred to as messaging domains within the JMS specification. Point-to-point messaging is accomplished by the implementation of message queues to which a producer writes a message to be received by a consumer. Publish-subscribe messaging is accomplished by the implementation of a hierarchy of topical nodes to which producers publish messages and to which consumers can subscribe.

JMS provides a core abstract messaging API that is extended by both the point-to-point message queuing model API and the publish-subscribe model API. In this chapter, we cover the core JMS architecture, basic point-to-point message queuing model, and basic publish-subscribe model. New to JMS v1.1 beyond JMS v1.0 is the unification of messaging domains such that the core JMS API can now be used to send and receive messages in either a point-to-point or a publish-subscribe fashion. Thus, in JMS v1.1, you can either use the core abstract and generic JMS APIs to send and receive messages or utilize the concrete point-to-point and publish-subscribe JMS APIs that subclass the generic JMS API.

The J2EE v1.3 specification requires that the JMS v1.0 API and an underlying service provider be included with a J2EE implementation. The J2EE v1.4 specification requires that the JMS v1.1 API and an underlying service provider be included with a J2EE implementation. However, BEA WebLogic Server 8.1 is geared only for J2EE v1.3 compliance. Hence, WebLogic Server 8.1 is equipped only with a JMS v1.0–compliant infrastructure. Nevertheless, a separate download of the JMS v1.1 API can offer JMS v1.1 functionality to your WebLogic Server 8.1.

Describing the JMS API and how it is used inside WebLogic Server is no simple task due to the rather large API embodied by JMS. Furthermore, a significant portion of the API is encapsulated inside of the core generic JMS API that is concretely extended by the publish-subscribe and point-to-point queuing APIs. We thus take the following approach toward describing JMS and its use within WebLogic Server 8.1 in the remainder of this chapter:

  • Describe the core generic JMS API

  • Describe the concrete point-to-point queuing JMS API, sample code, and how to configure and deploy inside of the WebLogic Server

  • Describe the concrete point-to-point queuing JMS API, sample code, and how to configure and deploy inside of the WebLogic Server

  • Describe the unified domain model JMS API, sample code, and how to configure and deploy inside of the WebLogic Server

  • Describe advanced JMS configuration and deployment features embodied by WebLogic Server

    [ Team LiB ] Previous Section Next Section