備考
メッセージの属性は、このオブジェクトに含まれているOraAQMsg
インタフェースを使用してアクセスできます。正常に実行された場合、このメソッドはメッセージ識別子をバイト配列で戻します。それ以外の場合は、空の配列(NULL)を戻します。
例
注意: 次のサンプル・コードは、メッセージ・デキューの標準的な例です。完全なAQサンプルは、 |
例: RAW型のメッセージのデキュー
'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
例: Oracleオブジェクト型のメッセージのデキュー
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