notifyEventsAsync(recvr: JadeGenericMessagingIF; option: Integer);
The notifyEventsAsync method of the JadeGenericQueue class registers an object specified by the recvr parameter, which must implement the JadeGenericMessagingIF interface, for notifications through callback methods for the following events.
A message arrives in the receiver queue (the event callback method is messageArrivedEvent)
A management event occurs on the queue (the event callback method is managementEvent)
The parameters for the notifyEventsAsync method are listed in the following table.
Parameter | Description |
---|---|
recvr | Object that is to receive the callback notifications |
option |
The number of callback notifications, which can be specified using one of the following class constants.
|
A process can register only one object to receive events for each queue. If the notifyEventsAsync method is called again, the new recvr object replaces the existing receiver of callback notifications.
To receive events for a queue, it must be opened by the openQueue method defined in the JadeMessagingFactory class, with Usage=Get or Usage=All included in the options parameter.
The following example shows the use of the notifyEventsAsync method to register an object for callbacks.
vars factory : JadeMessagingFactory; queue : JadeGenericQueue; begin create factory transient; queue := factory.openQueue("JadeMQ://localnode/TestQ", "Usage=All"); queue.notifyEventsAsync(receiver, JadeGenenericQueue.Notify_Continuous); epilog delete factory; end;