Java CAPS JMS Reference

Introduction to JMS

This topic provides a basic introduction into how the JavaTM Message Service (JMSTM) is implemented and used in Java CAPS.

JMS and Java CAPS

Java Message Service

The Java Message Service is a Java API used for sending and receiving messages. It is vendor-independent, and is used almost universally in enterprise messaging systems such as that included in Java CAPS. JMS provides a standard, currently embodied in the JMS version 1.1 specification, which is an integral part of the Java Enterprise Edition (Java EE) Platform 5. The features of the JMS version 1.1 specification have been widely adopted in the Java CAPS JMS implementation, as described in this document. The use of JMS allows loosely coupled, reliable, asynchronous interactions among Java EE components and legacy systems capable of messaging.

Version 1.1 of the JMS API includes the following features:

Additionally, the Java EE platform’s Enterprise JavaBeans (EJB) container architecture provides the following enhancements the JMS API:

JMS Message Servers

JMS message servers provide the global messaging protocols, such as the routing and delivery of messages, and connection to the JMS database.

By default, Sun Enterprise Service Bus contains the following message server options:

The Sun Java System Message Queue is the current default message server for Java CAPS 6.

The Sun JMS IQ Manager was the default JMS message server implementation for Sun SeeBeyond eGate Integrator, the predecessor to Sun Enterprise Service Bus. This software is installed automatically if you select Complete when installing from the GUI, or as an option if you use any other installation method. The JMS IQ Manager conforms to the Java Message specification 1.1 and supports both topic (publish-and-subscribe) and queue (point-to-point) messaging styles. Inside the JMS IQ Manager includes information about how the JMS IQ Manager processes messages, in concert with the JMS clients. JMS IQ Manager Runtime Configuration provides detailed information about the JMS IQ Manager property options.

JMS Message Destinations

A message destination is a container for stored data, and can follow either the JMS topic or queue model.

Each message destination has at least two JMS Clients associated with it: a producer client at its input, and a consumer client at (each) output. JMS message destinations are discussed in Developing Java CAPS Projects.

JMS Clients

JMS clients provide the local messaging protocols, such as message persistence and delivery semantics, for messages being propagated between Project components. Together with the JMS message server, they constitute a JMS provider.

JMS clients are of two basic types, producers and consumers, or a combination of both. If associated with a queue, these types become queue senders and receivers, respectively. If associated with a topic, they become topic publishers and subscribers, respectively.

JMS client configuration is discussed in JMS Client Configuration.

JMS Object Type Definitions

The JMS Object Type Definition (OTD) acts as a “wrapper” around a message or connection, allowing Collaborations to read from and write to topics or queues. It indicates to the Collaboration which topic or queue it expects to receive messages from or send messages to, and allows you to build the JMS business rules. The JMS OTD and its properties are discussed in JMS Object Type Definitions. JMS OTD methods are described in JMS OTD Methods and JMS Message Methods.

JMS Library File

JMS methods are contained in the JMS library file. In Java CAPS 6, this file is located in the following path:


…\appserver\domains\domain1\lib\com.stc.jms.stcjms.jar

Implementing JMS in Java CAPS Projects

Integration Model

The following diagram illustrates the integration model used by Java CAPS.

Figure 1–1 Sun Enterprise Service Bus Integration Model

Diagram showing deployment of Projects to runtime
Environments.

This model separates the business logic from the physical system used to perform the logical operations at runtime.

In this model, any of the Projects can be deployed to any of the Environments by means of the mapping defined in the Deployment Profiles. The example in the figure shows that the patient admittance Project is already in the production phase and therefore was deployed using the production Deployment Profile. The patient records Project is in the staging phase and was therefore deployed to the staging Environment using the staging Deployment Profile. The insurance billing Project is still being developed and tested, and therefore it is deployed to development and testing by means of the development and testing profiles.

ProcedureTo Implement JMS Following the Java CAPS Model

  1. For each Project, specify the message destinations and configure JMS connections for the business process.

  2. For each Environment, assign message servers to Logical Hosts (domains) and configure the message servers.

  3. For each Project, create a Deployment Profile to associate the message destinations and JMS connections with the message servers.

Creating and Configuring Message Destinations

In a Java CAPS Project, you specify the business logic for the Sun Enterprise Service Bus implementation. For each of the Project components you specify logical properties; these properties are independent from the physical implementation. For JMS-related components, Projects are where you add and name message destinations, by dragging and dropping topics and queue icons onto the Connectivity Map canvas See Developing Java CAPS Projects for information.

Creating OTDs and Collaborations

After having added the message destinations, you then create the Object Type Definitions (OTDs) and Collaboration Definitions. For any Java-based Collaboration Definition that reads from or writes to a JMS message destination, you must add the JMS web service. For information on the Java methods used in these Collaboration Definitions, see JMS OTD Methods and JMS Message Methods.

Configuring JMS Clients

Links between message destinations and their subscribers and publishers, display a JMS Client icon. By double-clicking the icon in the Connectivity Map, you can configure local connection properties such as persistent or non-persistent delivery mode, XA, and concurrent processing. Details of the configuration properties for JMS Clients are given in JMS Client Configuration.

Configuring Message Servers

In the runtime Environment, you specify which message servers are used, and which Logical Hosts (domains) they are to run on. Once you add a message server to a domain, you specify the physical configurations for the message server. You can configure global properties for JMS messaging such as the port number, message delivery order, tuning configurations, journaling options, and diagnostic options. Procedures for defining your Environment are described in Creating a Runtime Environment. Details of the configuration properties for the JMS IQ Manager are given in JMS IQ Manager Runtime Configuration.

Creating Component Mappings

When you define a Deployment Profile, you create mappings between Projects and Environments. In the Deployment Profile, you specify which components of the business process are located on which systems in a specific Environment. For the JMS, you specify which message destinations run on a particular message server. Note that inbound and outbound message destinations must be deployed to the same server. For more details, see Deploying Java CAPS Projects.

Using the JMS OTD in Collaboration Definitions

To enable Java based Collaboration Definitions to read from and write to topics or queues, you must add the JMS OTD to the Collaboration Definition. The JMS OTD contains a set of Java methods that are used by the JMS client to manage the JMS session. These methods are accessed by displaying the context menu for the OTD root node, and then choosing Select method to call from the menu. This option displays the method browser, shown in the following figure. You can also drag the node to the mapping area to display the browser.

Figure 1–2 Java Method Browser

Screen capture showing the Java Method Browser
dialog.

Using JMS Messages in Collaboration Definitions

To create Java based Collaboration Definitions that implement an existing web service, you must add the JMS receive, receiveWait, or send web service operation to the Collaboration Definition. Each of these operations has a set of Java methods that is available for use with it. These methods are accessed by displaying the context menu for the input or output node, and then choosing Select method to call from the menu. This option displays the method browser, shown in the following figure. You can also drag the node to the mapping area to display the browser.

Figure 1–3 Java Method Browser

Screen capture showing the Java Method Browser
dialog.