Commit a369ad96 authored by Savorboard's avatar Savorboard

add options of failed call-back.

parent 42eacd34
...@@ -13,28 +13,39 @@ namespace DotNetCore.CAP ...@@ -13,28 +13,39 @@ namespace DotNetCore.CAP
/// <summary> /// <summary>
/// Default value for polling delay timeout, in seconds. /// Default value for polling delay timeout, in seconds.
/// </summary> /// </summary>
public const int DefaultPollingDelay = 8; public const int DefaultPollingDelay = 15;
/// <summary>
/// Default processor count to process messages of cap.queue.
/// </summary>
public const int DefaultQueueProcessorCount = 2;
public CapOptions() public CapOptions()
{ {
PollingDelay = DefaultPollingDelay; PollingDelay = DefaultPollingDelay;
QueueProcessorCount = DefaultQueueProcessorCount;
Extensions = new List<ICapOptionsExtension>(); Extensions = new List<ICapOptionsExtension>();
} }
/// <summary> /// <summary>
/// Productor job polling delay time. Default is 5 sec. /// Productor job polling delay time. Default is 15 sec.
/// </summary>
public int PollingDelay { get; set; }
/// <summary>
/// Gets or sets the messages queue (Cap.Queue table) processor count.
/// </summary> /// </summary>
public int PollingDelay { get; set; } = 5; public int QueueProcessorCount { get; set; }
/// <summary> /// <summary>
/// Failed messages polling delay time. Default is 2 min. /// Failed messages polling delay time. Default is 3 min.
/// </summary> /// </summary>
public TimeSpan FailedMessageWaitingInterval = TimeSpan.FromMinutes(2); public TimeSpan FailedMessageWaitingInterval = TimeSpan.FromMinutes(3);
/// <summary> /// <summary>
/// We’ll send a POST request to the URL below with details of any subscribed events. /// We’ll invoke this call-back with message type,name,content when requeue failed message.
/// </summary> /// </summary>
public WebHook WebHook => throw new NotSupportedException(); public Action<Models.MessageType, string, string> FailedCallback { get; set; }
/// <summary> /// <summary>
/// Registers an extension that will be executed when building services. /// Registers an extension that will be executed when building services.
...@@ -48,11 +59,4 @@ namespace DotNetCore.CAP ...@@ -48,11 +59,4 @@ namespace DotNetCore.CAP
Extensions.Add(extension); Extensions.Add(extension);
} }
} }
public class WebHook
{
public string PayloadUrl { get; set; }
public string Secret { get; set; }
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment