|Oracle® Objects for OLE Developer's Guide
11g Release 2 (11.2) for Microsoft Windows
|PDF · Mobi · ePub|
OraAQAgent object represents a message recipient and is only valid for queues that allow multiple consumers.
OraAQAgent object can be instantiated by invoking the
AQAgent method. For example:
Set agent = qMsg.AQAgent(name)
The following Visual Basic example illustrates a simple use of the advanced queuing feature. A message of a user-defined type,
MESSAGE_TYPE, is enqueued into a queue,
msg_queue, that supports multiple consumers.
Dim q as OraAQ Dim qMsg as OraAQMsg Dim agent as OraAQAgent Set q = OraDatabase.CreateAQ("msg_queue") Set qMsg = q.AQMsg(1,"MESSAGE_TYPE") 'To add SCOTT as a recipient for the message, Set agent = qMsg.AQAgent("SCOTT") 'To enqueue, q.Enqueue