I can retrieve data using a TOraQueue succesfully.
Next step is asynchronous notification.
I've tried setting AsyncVVI_VVI_IN_OraQueue.AsyncNotification := True; after opening the connection, but my OnMessage is never called (the breakpoint never fires, I don't hear beeping without a breakpoint).
Below are the components and the source code.
What am I doing wrong here?
Components:
Code: Select all
object VVI_OraSession: TOraSession
Username = 'vvi'
Password = '########'
Server = 'AQUARIUS'
LoginPrompt = False
Left = 48
Top = 20
end
object AsyncVVI_VVI_IN_OraQueue: TOraQueue
Session = VVI_OraSession
QueueName = 'VVI.VVI_IN'
DequeueOptions.WaitTimeout = 5
AsyncNotification = True
OnMessage = AsyncVVI_VVI_IN_OraQueueMessage
Left = 128
Top = 96
end
Code: Select all
procedure TOracleAQDataModule.Enable_AsyncVVI_VVI_IN_OraQueue_AsyncNotification;
begin
AsyncVVI_VVI_IN_OraQueue.Session.Open();
AsyncVVI_VVI_IN_OraQueue.AsyncNotification := True;
end;
procedure TOracleAQDataModule.AsyncVVI_VVI_IN_OraQueueMessage(Sender: TOraQueue; const MessageId: string; const MessageProperties: TQueueMessageProperties);
begin
if Windows.GetCurrentThreadId() System.MainThreadID then // *** beakpoint here
SysUtils.Beep()
else
SysUtils.Beep();
end;