Oracle® Objects for OLE Developer's Guide 10g Release 1 (10.1) Part Number B10118-01 |
|
NOTE: The following code snippets serve as models for dequeuing messages.
A complete AQ sample can be found in \OO4O\VB\SAMPLES\AQ
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
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