Skip Headers
Oracle® Objects for OLE Developer's Guide
11g Release 2 (11.2) for Microsoft Windows

Part Number E17727-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

Dequeue (OraAQ) Method

Applies To

OraAQ Object

Description

Dequeues a message.

Usage

Q.Dequeue()

Remarks

The message attributes can be accessed with the OraAQMsg interface contained in this object. On success, this method returns the message identifier as an array of bytes. Otherwise, it returns an empty array (null).

Examples

Note:

The following code sample are models for dequeuing messages.

A complete AQ sample can be found in the \OO4O\VB\SAMPLES \AQ directory.

Example: Dequeuing Messages of RAW Type

'Dequeue the first message available  
Q.Dequeue 
Set Msg = Q.QMsg 
 
'Display the message content 
MsgBox Msg.Value 
 
'Dequeue the first message available without removing it 
' from the queue 
Q.DequeueMode = ORAAQ_DQ_BROWSE 
 
'Dequeue the first message with the correlation identifier 
' equal to "RELATIVE_MSG_ID" 
Q.Navigation = ORAAQ_DQ_FIRST_MSG 
Q.correlate = "RELATIVE_MESSAGE_ID" 
Q.Dequeue 
 
'Dequeue the next message with the correlation identifier 
 
' of "RELATIVE_MSG_ID" 
Q.Navigation = ORAAQ_DQ_NEXT_MSG 
Q.Dequeue 
 
'Dequeue the first high priority message 
Msg.Priority = ORAQMSG_HIGH_PRIORITY 
Q.Dequeue 
 
'Dequeue the message enqueued with message id of Msgid_1 
Q.DequeueMsgid = Msgid_1 
Q.Dequeue 
 
'Dequeue the message meant for the consumer "ANDY" 
Q.consumer = "ANDY" 
Q.Dequeue 
 
'Return immediately if there is no message on the queue  
Q.wait = ORAAQ_DQ_NOWAIT 
Q.Dequeue

Example: Dequeuing Messages of Oracle Object Types

Set OraObj = DB.CreateOraObject("MESSAGE_TYPE") 
Set QMsg = Q.AQMsg(23, "MESSAGE_TYPE","SCOTT")
 
'Dequeue the first message available without removing it 
Q.Dequeue 
OraObj = QMsg.Value 
 
'Display the subject and data 
MsgBox OraObj("subject").Value & OraObj("Data").Value