From d032b26d139184952907598e02b78f9465fe0a5d Mon Sep 17 00:00:00 2001 From: Savorboard Date: Wed, 18 Jul 2018 15:24:54 +0800 Subject: [PATCH] update samples. --- samples/Sample.RabbitMQ.MySql/Startup.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/samples/Sample.RabbitMQ.MySql/Startup.cs b/samples/Sample.RabbitMQ.MySql/Startup.cs index 554a624..007e78e 100644 --- a/samples/Sample.RabbitMQ.MySql/Startup.cs +++ b/samples/Sample.RabbitMQ.MySql/Startup.cs @@ -1,4 +1,5 @@ -using Microsoft.AspNetCore.Builder; +using System; +using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; @@ -16,6 +17,11 @@ namespace Sample.RabbitMQ.MySql x.UseEntityFramework(); x.UseRabbitMQ("localhost"); x.UseDashboard(); + x.FailedRetryCount = 5; + x.FailedThresholdCallback = (type, name, content) => + { + Console.WriteLine($@"A message of type {type} failed after executing {x.FailedRetryCount} several times, requiring manual troubleshooting. Message name: {name}, message body: {content}"); + }; }); services.AddMvc();