I'm trying for the first time to dequeue from a queue on my company production environment by ODP.NET and C#.
I used the official ODP.NET example to develop my client got from the installation examples folder.
The queue is an Oracle AQ Topic (multi consumer) addressed by many other company services written with J2EE.
I wrote the UDT mapping classes following the ODP development guidelines ( http://docs.oracle.com/cd/E11882_01/win.112/e23174/featUDTs.htm#ODPNT0024 ).
The issue is: my client connects to the queue, by it never gets any message (others connected java clients get them).
Here is my code (without UDT classes, for keep short my post):
string constr = "user id=<USER_ID>;password=<PASSWORD>;data source=<DATASOURCE>";
OracleConnection conListen = new OracleConnection(constr);
OracleAQQueue queueListen = new OracleAQQueue("<TOPIC_QUEUE_ID>", conListen);
try
{
conListen.Open();
queueListen.MessageType = OracleAQMessageType.Udt;
queueListen.DequeueOptions.ConsumerName = "Test_Subscriber_ID";
queueListen.UdtTypeName = "SYS.AQ$_JMS_TEXT_MESSAGE";
queueListen.DequeueOptions.Visibility = OracleAQVisibilityMode.OnCommit;
queueListen.DequeueOptions.Wait = 60;
OracleTransaction txn = conListen.BeginTransaction();
OracleAQMessage deqMsg = queueListen.Dequeue();
txn.Commit();
}
catch (Exception e)
{
Console.WriteLine("Error: {0}", e.Message);
}
finally
{
queueListen.Dispose();
conListen.Close();
conListen.Dispose();
}
Another detail: after the connection the "all_queue_subscribers" view doesn't containt my subscriber "Test_Subscriber_ID".
Thank you all!