7.Oracle Advanced Queuing Overview

Advanced Queuing Overview

Oracle Advanced Queuing provides an infrastructure for distributed applications to communicate asynchronously using messages. Oracle Advanced Queuing stores messages in queues for deferred retrieval and processing by the Oracle server. This provides a reliable and efficient queuing system without additional software such as transaction processing monitors or message-oriented middleware.

Uses for Message Queuing

Consider a typical online sales business. It includes an order entry application, an order processing application, a billing application, and a customer service application. Physical shipping departments are located at various regional warehouses. The billing department and customer service department can also be located in different places.

This scenario requires communication between multiple clients in a distributed computing environment. Messages pass between clients and servers as well as between processes on different servers. An effective messaging system implements content-based routing, content-based subscription, and content-based querying.

A messaging system can be classified into one of two types:

Synchronous Communication

Synchronous communication is based on the request/reply paradigm--a program sends a request to another program and waits until the reply arrives.

This model of communication (also called online or connected) is suitable for programs that need to get the reply before they can proceed with their work. Traditional client/server architectures are based on this model.

The major drawback of the synchronous model of communication is that the programs to whom the request is sent must be available and running for the calling application to work.

Asynchronous Communication

In the disconnected or deferred model, programs communicate asynchronously, placing requests in a queue and then proceeding with their work.

For example, an application might require entry of data or execution of an operation after specific conditions are met. The recipient program retrieves the request from the queue and acts on it. This model is suitable for applications that can continue with their work after placing a request in the queue -- they are not blocked waiting for a reply.

For deferred execution to work correctly even in the presence of network, machine and application failures, the requests must be stored persistently, and processed exactly once. This can be achieved by combining persistent queuing with transaction protection.

Processing each client/server request exactly once is often important to preserve both the integrity and flow of a transaction. For example, if the request is an order for a number of shares of stock at a particular price, then execution of the request zero or two times is unacceptable even if a network or system failure occurs during transmission, receipt, or execution of the request.

Advantages of Oracle Advanced Queuing

Oracle Advanced Queuing supports the following:

  • Point-to-point and publish-subscribe models of communication
  • Structured payload that can be queried using SQL
  • Recipient and subscription lists
  • Persistent and nonpersistent queues
  • Queue-level access control
  • Asynchronous notification
  • HTTP and SMTP access
  • Nonrepudiation service

Using Oracle Advanced Queuing, you can:

  • Propagate messages to other databases, local or remote.
  • Remove multiple messages from the queue as a bundle, specify multiple recipients, and wait for messages on multiple queues.
  • Prioritize messages and specify a window of execution for each message.
  • Perform AQ operations through HTTP/SMTP, using XML formatting.
  • Retain messages and message history for analysis.
  • Keep statistics on messages stored in queues and propagated to other queues.
  • Integrate transactions to simplify application development and management
  • Use Oracle9i Real Application Clusters to achieve higher performance

Because Oracle Advanced Queuing queues are implemented in database tables, all the operational benefits of high availability, scalability, and reliability apply to queue data. In addition, database development and management tools can be used with queues.

Applications can access the queuing functionality through the native interface for Oracle Advanced Queuing (defined in PL/SQL, C/C++, Java, and Visual Basic) or through the Java Messaging Service interface for Oracle Advanced Queuing (a Java API based on the Java Messaging Service standard).

See Also:

Oracle9i Application Developer's Guide - Advanced Queuing for detailed information about Oracle Advanced Queuing