Home -->
Technical Documents
- Java Caps (JCAPs)
- JVM
- Java
- Oracle
- Orakill
- Queues
Applications
Links
Blog
Have a topic I may know about? Email me

![]()
Use content on site at your own discretion.
Email: webmaster@corporatemutt.com Last Modified: 01/15/2008
To get started with queuing, there are four components that are required:
- Message Type
- Queue Table
- Queue
- Subscriber
These components will give you the ability to define what data you will be storing in the queue (message type), the storage component for the data stack (queue table, queue) and a mechanism to put/get data off of the stack (subscriber).
For the sake of this example, I am going to create a message type name "aMessage", a queue table name "qTable", a queue name "aQueue" and a subscriber named "subQueue".
First step, create message type:
create or replace type aMessage as object (
element VARCHAR2(255)
);
Second step, create queue table:
dbms_aqadm.create_queue_table(
queue_table => 'qTable',
multiple_consumers => true,
sort_list => 'priority,enq_time',
queue_payload_type => 'aMessage',
comment => 'Creating input queue table'
);
Third Step, create queue:
dbms_aqadm.create_queue(
queue_name => 'aQueue',
queue_table => 'qTable',
max_retries => 10,
retry_delay => 15,
retention_time => 600, -- 10 minutes
comment => 'Form-based Queue for messages'
);
Fourth (and final) step, create subscriber:
DECLARE
subscriber sys.aq$_agent;
BEGIN
-- ========================================
-- Create queue subscribers
-- ========================================
subscriber := sys.aq$_agent('subQueue', NULL, NULL);
dbms_aqadm.add_subscriber(
queue_name => 'aQueue',
subscriber => subscriber);
END;