Commit 3740261a authored by yangxiaodong's avatar yangxiaodong

refactor.

parent 7454bf53
...@@ -8,6 +8,6 @@ namespace DotNetCore.CAP ...@@ -8,6 +8,6 @@ namespace DotNetCore.CAP
/// <summary> /// <summary>
/// EF dbcontext type. /// EF dbcontext type.
/// </summary> /// </summary>
public Type DbContextType { get; internal set; } internal Type DbContextType { get; set; }
} }
} }
\ No newline at end of file
...@@ -33,12 +33,12 @@ namespace DotNetCore.CAP ...@@ -33,12 +33,12 @@ namespace DotNetCore.CAP
/// </summary> /// </summary>
public const string DefaultExchangeName = "cap.default.topic"; public const string DefaultExchangeName = "cap.default.topic";
/// <summary> The topic exchange type. </summary>
public const string ExchangeType = "topic";
/// <summary>The host to connect to.</summary> /// <summary>The host to connect to.</summary>
public string HostName { get; set; } = "localhost"; public string HostName { get; set; } = "localhost";
/// <summary> The topic exchange type. </summary>
internal const string ExchangeType = "topic";
/// <summary> /// <summary>
/// Password to use when authenticating to the server. /// Password to use when authenticating to the server.
/// </summary> /// </summary>
...@@ -80,8 +80,8 @@ namespace DotNetCore.CAP ...@@ -80,8 +80,8 @@ namespace DotNetCore.CAP
public int Port { get; set; } = -1; public int Port { get; set; } = -1;
/// <summary> /// <summary>
/// Gets or sets queue message automatic deletion time. Default 10 days. /// Gets or sets queue message automatic deletion time (in milliseconds). Default 864000000 ms (10 days).
/// </summary> /// </summary>
public TimeSpan XMessageTTL { get; set; } = TimeSpan.FromDays(10); public int QueueMessageExpires { get; set; } = 864000000;
} }
} }
\ No newline at end of file
...@@ -54,7 +54,7 @@ namespace DotNetCore.CAP.RabbitMQ ...@@ -54,7 +54,7 @@ namespace DotNetCore.CAP.RabbitMQ
type: RabbitMQOptions.ExchangeType, type: RabbitMQOptions.ExchangeType,
durable: true); durable: true);
var arguments = new Dictionary<string, object> { { "x-message-ttl", (int)_rabbitMQOptions.XMessageTTL.TotalMilliseconds } }; var arguments = new Dictionary<string, object> { { "x-message-ttl", (int)_rabbitMQOptions.QueueMessageExpires } };
_channel.QueueDeclare(_queueName, _channel.QueueDeclare(_queueName,
durable: true, durable: true,
exclusive: false, exclusive: false,
......
...@@ -16,6 +16,6 @@ namespace DotNetCore.CAP ...@@ -16,6 +16,6 @@ namespace DotNetCore.CAP
/// <summary> /// <summary>
/// EF dbcontext type. /// EF dbcontext type.
/// </summary> /// </summary>
public Type DbContextType { get; internal set; } internal Type DbContextType { get; set; }
} }
} }
\ No newline at end of file
...@@ -40,18 +40,18 @@ namespace DotNetCore.CAP ...@@ -40,18 +40,18 @@ namespace DotNetCore.CAP
/// <summary> /// <summary>
/// Failed messages polling delay time. Default is 3 min. /// Failed messages polling delay time. Default is 3 min.
/// </summary> /// </summary>
public TimeSpan FailedMessageWaitingInterval = TimeSpan.FromMinutes(3); public int FailedMessageWaitingInterval { get; set; } = (int)TimeSpan.FromMinutes(3).TotalSeconds;
/// <summary> /// <summary>
/// We’ll invoke this call-back with message type,name,content when requeue failed message. /// We’ll invoke this call-back with message type,name,content when requeue failed message.
/// </summary> /// </summary>
public Action<Models.MessageType, string, string> FailedCallback { get; set; } 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.
/// </summary> /// </summary>
/// <param name="extension"></param> /// <param name="extension"></param>
public void RegisterExtension(ICapOptionsExtension extension) public void RegisterExtension(ICapOptionsExtension extension)
{ {
if (extension == null) if (extension == null)
throw new ArgumentNullException(nameof(extension)); throw new ArgumentNullException(nameof(extension));
......
...@@ -27,7 +27,7 @@ namespace DotNetCore.CAP.Processor ...@@ -27,7 +27,7 @@ namespace DotNetCore.CAP.Processor
_logger = logger; _logger = logger;
_provider = provider; _provider = provider;
_stateChanger = stateChanger; _stateChanger = stateChanger;
_waitingInterval = _options.FailedMessageWaitingInterval; _waitingInterval = TimeSpan.FromSeconds(_options.FailedMessageWaitingInterval);
} }
public async Task ProcessAsync(ProcessingContext context) public async Task ProcessAsync(ProcessingContext context)
......
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