azure web sites - WebJobs Not Retrying Failed Queue Message -
i have following logic in webjob using new 0.3.0-beta webjobs sdk. when code fails processing message, azure dashboard shows aggregate exception (which makes sense since async). however, not retry processing message.
the little documentation i've been able find indicates message should retried within 10 minutes of failure. not case new sdk?
public static task processmymessageasync( [queuetrigger(config.my_queue)] string msg, int dequeuecount, cancellationtoken cancellationtoken) { var processor = config.container.getinstance<imessageprocessor>(); return processor.handlejobasync(msg, dequeuecount, cancellationtoken); }
the exception stems sql timeout exception (its db query against sql azure in code):
system.aggregateexception: system.aggregateexception: 1 or more errors occurred. ---> system.data.entity.core.entitycommandexecutionexception: error occurred while executing command definition. see inner exception details. ---> system.data.sqlclient.sqlexception: timeout expired. timeout period elapsed prior completion of operation or server not responding. ---> system.componentmodel.win32exception: wait operation timed out
you should set maxdequeuecount.
jobhostconfiguration jobhostconf = new jobhostconfiguration(); jobhostconf.queues.maxdequeuecount = 10; var host = new jobhost(jobhostconf); host.runandblock();
that retry 10 times, before messages put on dead/bad letter queue.
you use custom retry policy in function. suggest @ "the transient fault handling application block" https://msdn.microsoft.com/en-us/library/hh680934(v=pandp.50).aspx
or enable retry in ef sqlazureexecutionstrategy https://msdn.microsoft.com/en-us/data/dn456835.aspx
Comments
Post a Comment