Browse Source

add options of failed call-back.

master
Savorboard 7 years ago
parent
commit
a369ad960e
1 changed files with 18 additions and 14 deletions
  1. +18
    -14
      src/DotNetCore.CAP/CAP.Options.cs

+ 18
- 14
src/DotNetCore.CAP/CAP.Options.cs View File

@@ -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
Extensions.Add(extension); Extensions.Add(extension);
} }
} }

public class WebHook
{
public string PayloadUrl { get; set; }

public string Secret { get; set; }
}
} }

Loading…
Cancel
Save