Overview: Messaging Systems and JMS

This topic describes the characteristics of messaging systems that are accessible via JMS (Java Message Service), and therefore via the WebLogic Workshop JMS control.

To learn about WebLogic Workshop controls, see Controls: Using Resources from a Web Service.

To learn about the JMS control, see JMS Control: Using Java Message Service Queues and Topics from your Web Service.

To learn about specific messaging scenarios that are supported by the JMS control, see Messaging Scenarios Supported by the JMS Control.

# Messaging Systems

Messaging systems provide communication between software components. A client of a messaging system can send messages to, and receive messages from, any other client. Each client connects to a messaging server that provides facilities for sending and receiving messages. WebLogic JMS, which is a component of WebLogic Server is an example of a messaging server. WebLogic Server also supports third party messaging systems.

Messaging systems provide distributed communication that is asynchronous. A component sends a message to a destination. A message recipient can retrieve messages from a destination. The sender and receiver do not communicate directly. The sender only knows that a destination exists to which it can send messages, and the receiver also knows there is a destination from which it can receive messages. As long as they agree what message format and what destination to use, the messaging system will manage the actual message delivery.

Messaging systems also may provide reliability. The specific level of reliability is typically configurable on a per-destination or per-client basis, but messaging systems are capable of guaranteeing that a message will be delivered, and that it will be delivered to each intended recipient exactly once.

JMS supports two basic styles of message-based communications: point-to-point and publish and subscribe.

# JMS Queues for Point-to-Point Messaging

Point-to-point messaging is accomplished with JMS queues. A queue is a specific named resource that is configured in a JMS server.

A JMS client, of which the JMS control is an example, may send messages to a queue or receive messages from a queue. Point-to-point messages have a single consumer. Multiple receivers may listen for messages on the same queue, but once any receiver retrieves a particular message from the queue that message is consumed and is no longer available to other potential consumers.

A message consumer acknowledges receipt of every message it receives.

The messaging system will continue attempting to resend a particular message until a predetermined number of retries have been attempted.

# JMS Topics for Publish and Subscribe Messaging

Publish and subscribe messaging is accomplished with JMS topics. A topic is a specific named resource that is configured in a JMS server.

A JMS client, of which the JMS control is an example, may publish messages to a topic or subscribe to a topic. Published messages have multiple potential subscribers. All current subscribers to a topic receive all messages published to that topic after the subscription becomes active.

# Connection Factories

Before a JMS client can send or receive messages to a queue or topic, it must obtain a connection to the messaging system. This is accomplished via a connection factory. A connection factory is a resource that is configured by the message server administrator. The names of connection factories are stored in a JNDI directory for lookup by clients wishing to make a connection.

There is a default connection factory pre-configured in WebLogic Workshop, named cgConnectionFactory. This connection factory is used for all JMS controls that do not explicitly override it.

Related Topics

JMS Control: Using Java Message Service Queues and Topics from your Web Service