tags:

views:

194

answers:

0

I have attempted to get the advanced queueing code work with no good results. It just doesnt call the callback function when i add a new entry in the queue from Sql Plus or SQL DEveloper. I have put the Callback class as an Active X DLL. Any help is appreciated.

Form Level Code

Dim S As String

'Create the OraSession Object Set SS = CreateObject("OracleInProcServer.XOraSession")

'Create the OraDatabase Object by opening a connection to Oracle. Set DB = SS.DbOpenDatabase("database", "user/password", ORADB_ENLIST_FOR_CALLBACK)

Set Q = DB.CreateAQ("schema.msg_queue")

Q.Consumer = "Consumer" S = "Consumer"

Q.MonitorStart CB_Client, Q, S,ORAAQ_CONSUMER_ANY

This is my callback class

Public Sub NotifyMe(ByRef Ctx As Variant, ByRef Payload As Variant)

Dim OraMsg As OraAQMsg Dim OraObj As OraObject Dim OraQ As OraAQ

Dim S As Consumer S = "Consumer"

Set OraQ = Ctx

OraQ.Consumer = S

OraQ.Wait = ORAAQ_DQ_WAIT_FOREVER

Set OraMsg = OraQ.AQMsg(ORATYPE_OBJECT, "message_type", "schema")

OraQ.Dequeue

Set OraObj = OraMsg.Value

MsgBox "SUBJECT Data = " & "|" & OraObj.Item(1).Value & "|" & OraObj("SUBJECT").Value & "|" & vbCrLf & _ "TEXT Data = " & "|" & OraObj.Item(2).Value & "|" & OraObj("TEXT").Value & "|", vbOKOnly, "NotifyMe" ' Set OraObj = Payload ' MsgBox "SUBJECT Data = " & "|" & OraObj.Item(1).Value & "|" & OraObj("SUBJECT").Value & "|" & vbCrLf & _ ' "TEXT Data = " & "|" & OraObj.Item(2).Value & "|" & OraObj("TEXT").Value & "|", vbOKOnly, "NotifyMe"

End Sub