Messaging is the exchange of information by two or more software applications. A message is a self-contained package of information. Message systems allow senders and receivers to be decoupled so that not all components need to be up, running, and connected at all times. For example, a messaging system can be asynchronous in that an application can send messages that are successfully delivered even if one or more target applications are temporarily down.
Real time messaging services (RTMS) provide a way to capture transactions in an Adaptive Server Enterprise database and deliver them as events to external applications through a Java Messaging Service (JMS) message bus, provided by TIBCO Enterprise for JMS. RTMS provides an easy way to perform messaging operations within SQL statements. JMS is an API that defines the way in which clients communicate with message providers. Sender and receiver both act as clients to the message provider.
Real time means that the database can trigger events at the same time as they occur, rather than simply queuing the events. For example, a change in a record may be evaluated in conjunction with other changes, and the most efficient response chosen.
JMS defines two messaging models:
Point-to-point: A one-to-one model in which an application, called a message sender, can send any message, which can be read only by one receiving application, called a message receiver. The destination of a point-to-point message is a queue. A queue can contain more than one active message receiver, but the messaging provider ensures that the message is delivered to only one message receiver.
Publish and consume: A one-to-many model, in which the sender, or message producer, initiates the message but does not depend on message consumers receiving the message. The destination of this kind of message is called a topic. Message consumers establish subscriptions to register an interest in messages sent to a topic. There are two types of subscriptions for this model:
Durable: A durable subscription retains messages for the message consumer even when the message consumer application is not connected.
Nondurable: A nondurable subscription retains messages only when consumer applications are connected to the message provider.
Messaging wizards exist for sending and receiving a message or publishing and consuming a topic. You can invoke a messaging wizard using the following steps:
From Database Explorer, select a procedural object for messaging. Its code appears in SQL Editor.
Placing the cursor in the desired location in the code in SQL Editor, use the context menu to open the Messaging wizard. Select the appropriate action for sending a message to or receiving a message from a queue, or for publishing to and consuming a topic. The wizard walks you through the steps of generating the messaging syntax.
To publish or subscribe to a topic, you must first register a subscription. For more information, see Registering a Subscription.
Enabling ASE Real-Time Messaging Services
Sending a Message to a JMS Queue
Receiving a Message from a JMS Queue
Publishing a Message to a Topic
Consuming a Message from a Topic.
See the Adaptive Server Enterprise Messaging Services User's Guide for Real-Time Data Services.
Send your feedback on this help topic to Sybase Tech Pubs: pubs@sybase.com