Chapter 31 Using the Message Service


Overview

The message service allows you to publish or send messages to a queue, where they are stored until they can be delivered to the queue's recipient, which is either a client or a component. The message service provides a pull-style mechanism for client notification and a push-style mechanism for component notification. Clients can check their queue for new messages. Components can also check for new messages and they can register to be notified when messages arrive in their queue.

The message service provides transient and persistent message storage for message consumers and allows message producers to send messages to a particular message queue, or to publish messages with specific topics, available to all message queues.

The key features of the EAServer message service include:

Message service administration

You can administer message service using either the message service graphical user interface, or the message service API. The graphical user interface tool is a Java applet, built using the Swing GUI classes.

High availability

The message service uses server clustering to provide high availability. If a CORBA COMM_FAILURE system exception occurs while a client is accessing a message queue with acknowledge, list, or receive, the client can obtain a replacement message queue object by calling getMessageQueue. If this is necessary, and the original message queue's options did not include REQUIRES_TRANSACTION, or if the messages were not saved to persistent storage, some messages may have been lost.

Load balancing

The message service uses server clustering to provide load balancing. For complete information about using server clustering, refer to Chapter 3, "Jaguar Clusters and Synchronization" in the Jaguar CTS System Administration Guide.

Message security

The message service provides role-based security for message queues and message topics. The message service API operations and the access categories required to use them are:

Access category

Message service API operations

CONSUMER

addListener, getListeners, removeListener, addSelector, getSelectors, removeSelector, getMessageQueue, and getStatistics

PRODUCER

publish and send

SECURITY

addRole, getRoles, and removeRole

You need to assign permission for each access category separately.

Reliable delivery

To ensure reliable message delivery, the message service provides:

Scalable notification

The message queue object is implemented with a specialized server IIOP handler that uses only a few waiting threads to handle blocking receive calls, so it avoids waking large numbers of threads for client notification.

Since the IIOP handler for the MessageService interface assigns one thread per client connection, clients should use the ORB initialization property IdleConnectionTimeout so that a server can handle a large number of concurrent clients without allocating a large number of threads.

Scheduled messages

The message service can generate and send regularly scheduled messages. This feature can be used together with component notification to execute commands at specified dates and times, which provides functionality similar to that of the UNIX cron command. See Subscribing to scheduled messages for more information.

Transaction management

A transactional operation runs in the caller's transaction, or if the caller is not enlisted in a transaction, in a new transaction. These operations can be transactional:

 


Copyright © 2000 Sybase, Inc. All rights reserved.