Configure Number of retrys

33 views
Skip to first unread message

sunil kumar

unread,
Nov 18, 2015, 7:07:56 PM11/18/15
to nginn-messagebus
Hi All,
I need to configure the number of retries which nginn do if the processed record as failed.  Can  i know how to configure instead of default behavior of 10 times and then moving to Failure? I need to configure it to 2 after 2 retrying i want move the record to failure.

Rafal Gwizdala

unread,
Nov 19, 2015, 1:14:51 AM11/19/15
to nginn-me...@googlegroups.com
use
MessageBusConfigurator.SetRetryTimes


On Thu, Nov 19, 2015 at 1:07 AM, sunil kumar <k.sunil...@gmail.com> wrote:
Hi All,
I need to configure the number of retries which nginn do if the processed record as failed.  Can  i know how to configure instead of default behavior of 10 times and then moving to Failure? I need to configure it to 2 after 2 retrying i want move the record to failure.

--
You received this message because you are subscribed to the Google Groups "nginn-messagebus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nginn-messageb...@googlegroups.com.
To post to this group, send email to nginn-me...@googlegroups.com.
Visit this group at http://groups.google.com/group/nginn-messagebus.

sunil kumar

unread,
Nov 19, 2015, 11:17:10 AM11/19/15
to nginn-messagebus
I Kept that however it is not retrying for the value which i have given it is retrying for 10 times and then going to F. However i believe it is to specify the time interval to retry correct me if i am wrong.

Rafal Gwizdala

unread,
Nov 19, 2015, 12:29:56 PM11/19/15
to nginn-me...@googlegroups.com
You specify time intervals for subsequent retries. For example, 7 retries:

TimeSpan.FromSeconds(30),
TimeSpan.FromMinutes(3),
TimeSpan.FromMinutes(20),
TimeSpan.FromHours(2),
TimeSpan.FromHours(8),
TimeSpan.FromHours(24),
TimeSpan.FromDays(3)

sunil kumar

unread,
Nov 19, 2015, 3:41:49 PM11/19/15
to nginn-messagebus
If i have mentioned only two timespans it will retry only for two times? and go to failed state?

Rafal Gwizdala

unread,
Nov 20, 2015, 7:36:55 AM11/20/15
to nginn-me...@googlegroups.com
yep

sunil kumar

unread,
Nov 22, 2015, 2:03:24 PM11/22/15
to nginn-messagebus
But whenever i has restarted the windows service why is it retrying again all the records which is in R state?

sunil kumar

unread,
Nov 22, 2015, 2:06:13 PM11/22/15
to nginn-messagebus
And also though i have mentioned only two it is taking 10 times. below is my code base.

 TimeSpan[] intervals = new TimeSpan[]
            {
                TimeSpan.FromSeconds(30),
                TimeSpan.FromSeconds(120),
                //TimeSpan.FromMinutes(20),
                //TimeSpan.FromHours(2),
                //TimeSpan.FromHours(8),
                //TimeSpan.FromHours(24),
                //TimeSpan.FromDays(3)
            };
            MessageBusConfigurator.Begin()
                .AddConnectionString("Database", ConfigurationManager.ConnectionStrings["Database"].ConnectionString)
                .SetEndpoint(ConfigurationManager.AppSettings["QueueName"])
                .AddMessageHandlersFromAssembly(typeof(Program).Assembly)
                .SetMaxConcurrentMessages(int.Parse(ConfigurationManager.AppSettings["NoOfWorkerThreads"]))
                .SetRetryTimes(intervals)
                .SetUseTransactionScope(false)
                .AutoStartMessageBus(true)
                .FinishConfiguration();

Please let me know am i doing anything wrong?

Rafal Gwizdala

unread,
Nov 22, 2015, 2:22:06 PM11/22/15
to nginn-me...@googlegroups.com
Don't know what can be wrong. 
Which version are you using?
And regarding the 'R' messages, what is their retry_date? If it's in future then they should stay 'R' and only be moved to 'I' when the retry_date passes.
R

sunil kumar

unread,
Nov 22, 2015, 2:38:41 PM11/22/15
to nginn-me...@googlegroups.com
Using 1.1.3.0

--
You received this message because you are subscribed to a topic in the Google Groups "nginn-messagebus" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nginn-messagebus/-o88CGLEJTU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nginn-messageb...@googlegroups.com.

To post to this group, send email to nginn-me...@googlegroups.com.
Visit this group at http://groups.google.com/group/nginn-messagebus.



--
Regards
sunil

Rafal Gwizdala

unread,
Nov 22, 2015, 2:42:15 PM11/22/15
to nginn-me...@googlegroups.com
pretty old and i remember the number of retries configuration didn't work in the past
get a new one (warning: .net 4.5 required)

Reply all
Reply to author
Forward
0 new messages