Advanced Queuing   «Prev  Next»

Lesson 10

Advanced Queuing Conclusion in Oracle

With this module, you have received a brief introduction to Advanced Queuing. Even though the basic operations that are used with Advanced Queuing are fairly simple, the amount of flexibility built into this feature allows an incredible range of implementation scenarios.
In this lesson, you learned how to:
  1. Define Advanced Queuing and the entities involved
  2. Describe important data dictionary views that contain information about Advanced Queuing
  3. Describe the prebuilt PL/SQL packages used to create an Advanced Queuing application
  4. Use PL/SQL to create an Advanced Queuing application
  5. Set up enqueuing to the Advanced Queue
  6. Set up dequeuing from the Advanced Queue
  7. Set up propagation functionality with PL/SQL
  8. Run the application you have created with Advanced Queuing

We have only scratched the surface of the many different ways you can use Advanced Queuing, but you should have a basic understanding that will allow you to use this feature as you plan your applications.

Oracle PL/SQL Queuing Mechanism

Queuing mechanisms are essential in data management, especially in robust and transaction-heavy systems like Oracle. Oracle Advanced Queuing (AQ) provides message-oriented middleware capabilities that facilitate asynchronous communication between distributed applications. This queuing system is implemented in the Oracle PL/SQL realm and forms the basis for Oracle Streams. This document elaborates on the intricacies of the queuing mechanism in Oracle PL/SQL.
  1. Conceptual Overview:
    At its core, Oracle AQ is designed to support the following:
    1. Asynchronous processing: Enables decoupling of different applications or different components of a single application.
    2. Reliable messaging: Assures that messages, once enqueued, are reliably communicated to the receiver.
  2. Core Components
    The main components of Oracle AQ are:
    1. Queue Table: The foundation where messages are stored. Each table can be associated with multiple queues.
    2. Queue: Holds the messages. A queue is always associated with a single queue table.
    3. Message: Contains the information payload to be shared.
  3. Enqueuing and Dequeuing:
    1. Enqueuing: This process refers to inserting a message into the queue. When you enqueue a message, you specify the queue name and a message payload. Oracle AQ provides the DBMS_AQ.ENQUEUE procedure for this purpose.
    2. Dequeuing: This refers to retrieving a message from the queue. Dequeuing can be in 'browse' mode (where the message remains in the queue) or 'remove' mode (where the message is deleted from the queue). Oracle AQ offers the DBMS_AQ.DEQUEUE procedure for dequeuing messages.
  4. Message Propagation:
    Messages can be propagated between queues (even across different databases). This is achieved via database links and allows for the asynchronous communication between distributed applications.
  5. Message States:
    A message in a queue can have various states, including:
    1. WAITING: Message is waiting to be processed.
    2. READY: Message is ready for processing.
    3. PROCESSED: Message has been processed.
    4. EXPIRED: Message was not dequeued before its expiration time.
  6. Queue Types:
    Oracle AQ supports two main types of queues:
    1. Normal Queues: Supports both persistent and non-persistent messages.
    2. Exception Queues: Used for messages that cannot be processed successfully.
  7. Multi-consumer Queues:
    One of the powerful features of Oracle AQ is the support for multi-consumer queues. This means a single message can be enqueued once but can be consumed by multiple subscribers or applications.

Oracle's PL/SQL queuing mechanism, facilitated by Advanced Queuing, offers a sophisticated and robust way to handle asynchronous data messaging and communication in distributed applications. By leveraging AQ's capabilities, developers can ensure reliable, scalable, and efficient message processing within the Oracle ecosystem.

Glossary

The following terms were defined in this module:
  1. Asynchronous: A process where a command is submitted and the submitter does not wait for a response from the recipient of the command.
  2. Package: A group of PL/SQL procedures that are combined into a single logical grouping. The package header contains the interface description for the procedures, whereas the package body contains the actual code for the procedures in the package.
  3. Procedure: Uses PL/SQL code and syntax to implement a logical operation.
  4. Type definition: Defines an Oracle object type.
  5. Wrapper: Code that wraps a type of logic with some other code to make a cleaner interface.
In the next module, you will learn about working with large objects in Oracle.

Advanced Queuing - Quiz


Click the Quiz link below to test your understanding of the concepts presented in this module.
Advanced Queuing - Quiz

Ad  Oracle 12c Performance Tuning