Hi,
I am trying to fetch the MaxRetries property on the OracleQueueAdmin class, but it always returns back 0.0 (not sure why this is double data type in the first place). Below is the code. please let me know what i am doing wrong. Also, please let me know how do i get the retrycount on a item in the queue (via c# code), as i need to know how many tries i have before the item moves to exception queue.
using (OracleQueueAdmin adminQueue = new OracleQueueAdmin("ORDERRESULTS_QUEUE", oracleConnection))
{
double d = adminQueue.Options.MaxRetries;
}
Thanks,
Ramana
OracleQueueAdmin class..
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
First of all, you should specify the QueueTableName property of the OracleQueueAdmin class. Then, if you want to get the MaxRetries property of 'ORDERRESULTS_QUEUE' queue, you have to call the adminQueue.ReadQueueProperties() method. This methods reads options for a queue, specified in the QueueName property, from a server.ramana.bhavaraju wrote:Below is the code. please let me know what i am doing wrong.
For more information, please refer to http://www.devart.com/dotconnect/oracle ... rties.html
We will get the following code:
Code: Select all
using (OracleQueueAdmin adminQueue = new OracleQueueAdmin("ORDERRESULTS_QUEUE", oracleConnection))
{
adminQueue.QueueTableName = "Your queue table name";
adminQueue.ReadQueueProperties();
double d = adminQueue.Options.MaxRetries;
}
You can find the retry count with an OracleQueue instance. You can use the following code:ramana.bhavaraju wrote:Also, please let me know how do i get the retrycount on a item in the queue (via c# code), as i need to know how many tries i have before the item moves to exception queue.
Code: Select all
OracleQueue OraQueue = new OracleQueue("ORDERRESULTS_QUEUE", oracleConnection);
Console.WriteLine(OraQueue.EnqueueMessageProperties.Attempts);
-
- Posts: 14
- Joined: Thu 28 Jan 2010 17:13
The attempts count did not work..
The first code worked, but the attempts count is always returning back a zero. Also i am surprised that the API is on the Queue object and not on the item, as i expected each item in the queue to have a different attempt count. Please let me know what i am doing wrong. Below is the code i am using.
using (OracleQueue queue = new OracleQueue("ORDERRESULTS_QUEUE", oracleConnection))
{
int attempt = queue.EnqueueMessageProperties.Attempts;
}
using (OracleQueue queue = new OracleQueue("ORDERRESULTS_QUEUE", oracleConnection))
{
int attempt = queue.EnqueueMessageProperties.Attempts;
}
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
The value of the Attempts property will increase only when dequeuing message fails. If dequeuing is completed normally then the message is dequeued and Attempts does not change. So the MaxRetries property shows how many times you can fail in dequeue and the Attempts property shows how many times you have already failed.ramana.bhavaraju wrote:The first code worked, but the attempts count is always returning back a zero.
Attempts is a property of the OracleQueueMessageProperties class. The OracleQueueMessageProperties of the OracleQueueMessageProperties class the information that AQ uses to manage individual messages. You have access to the OracleQueueMessageProperties class via the QueueOracle instance.ramana.bhavaraju wrote:Also i am surprised that the API is on the Queue object and not on the item, as i expected each item in the queue to have a different attempt count.
Code: Select all
queue.EnqueueMessageProperties