Hi,
Is there anyway to dequeue (retrieve an item) from the exception queue, via code.
Thanks,
Ramana
Exception queue..
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Yes, you can dequeue messages from the exception queue. Each queue table contains a default exception queue. The exception queue is not dequeue-enabled by default, so you have to start this queue. When a message goes to the exception queue, the name of this message is changed to AQ$__E.
I'm posting here a small example where I dequeue a message from the exception queue. Let's consider that tha name of our queue table is QUEUE_TABLE:
I'm posting here a small example where I dequeue a message from the exception queue. Let's consider that tha name of our queue table is QUEUE_TABLE:
Code: Select all
...
OracleQueueAdmin adm = new OracleQueueAdmin("AQ$_QUEUE_TABLE_E", "QUEUE_TABLE", conn);
adm.StartDequeue();
OracleQueue oracleDequeueQueue = new OracleQueue("AQ$_QUEUE_TABLE_MESSAG_E", conn);
OracleQueueMessage msg = oracleDequeueQueue.Dequeue();
...
-
- Posts: 14
- Joined: Thu 28 Jan 2010 17:13
Can we dequeue the item from error queue multiple times using code below.
using (OracleQueue exceptionQueue = new OracleQueue(queue.ExceptionQueueName, conn))
{
OracleQueueDequeueOptions options = new OracleQueueDequeueOptions();
options.WaitTimeout = 0;
options.DequeueMode = OracleQueueDequeueMode.Browse;OracleQueueMessage msg = exceptionQueue.Dequeue(options);
}
using (OracleQueue exceptionQueue = new OracleQueue(queue.ExceptionQueueName, conn))
{
OracleQueueDequeueOptions options = new OracleQueueDequeueOptions();
options.WaitTimeout = 0;
options.DequeueMode = OracleQueueDequeueMode.Browse;OracleQueueMessage msg = exceptionQueue.Dequeue(options);
}
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Your exceptionQueue and options objects are not aware of each other. I have modified your code a bit, and now you can dequeue the item without deleting it from the exception queue.
Code: Select all
using (OracleQueue exceptionQueue = new OracleQueue(queue.ExceptionQueueName, conn))
{
exceptionQueue.DequeueOptions.WaitTimeout = 0;
exceptionQueue.DequeueOptions.DequeueMode = OracleQueueDequeueMode.Browse;
exceptionQueue.Dequeue(options);
}