Chapter 31: Using the Message Service  Developing JMS applications

Chapter 31: Using the Message Service


The message service allows you to send or publish messages to a queue or topic, where they are stored until they can be delivered to either a client or a component. The message service supports two messaging models, point-to-point and publish/subscribe. Use point-to-point messaging to send a message to one consumer. Use the publish/subscribe model to publish messages that are available to all consumers who subscribe to the message topic. The message service provides transient and persistent message storage for message consumers.

A messaging service provides a highly flexible solution for many business needs. As a practical example, consider a business-to-business (B2B) scenario in which a supplier needs to communicate prices to a number of retailers, and the retailers may want to place orders for items at updated prices.

You would create a listener to respond to all incoming orders, and you would manage the list of retailers, as well as add new ones. You would ensure that each party received and processed all the transactions that are sent its way. If one of the retailers is offline, or network routing to its server fails, your application design must continue trying to establish communications until the transaction can be successfully sent. You would provide persistence for critical transactions until all recipients acknowledge them. You would also want to ensure that all parties are granted access and are who they say they are, and that transactions are secure during transmission.

Many B2B transactions take place in an environment such as this, where connectivity cannot be guaranteed and transactions require security. Inserting a messaging service between business nodes in a B2B network insulates your application code from these issues.

The key features of the EAServer message service include:

High availability and load balancing

The message service uses server clustering to provide high availability and load balancing. For complete information about using server clustering, see Chapter 6, “Clusters and Synchronization,” in the EAServer System Administration Guide.

Message security

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

Access category

Message service operations


Adding, removing, or acquiring access to listeners and message selectors, retrieving message queue and topic statistics


Sending and publishing messages


Adding, configuring, and removing access roles

You need to assign permission for each access category separately.

Reliable delivery

To ensure reliable message delivery, the message service provides:

Scalable notification

When a thread pool is used for client 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.

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 © 2005. Sybase Inc. All rights reserved. Developing JMS applications