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).
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