Commit 311d5e92 authored by yangxiaodong's avatar yangxiaodong

Move some options config to other proejct.

parent cedd9d9f
......@@ -24,7 +24,9 @@ namespace DotNetCore.CAP.EntityFrameworkCore
/// <summary>
/// Gets or sets the <see cref="DbSet{ConsistencyMessage}"/> of Messages.
/// </summary>
public DbSet<CapMessage> Messages { get; set; }
public DbSet<CapSentMessage> CapSentMessages { get; set; }
public DbSet<CapReceivedMessage> CapReceivedMessages { get; set; }
/// <summary>
/// Configures the schema for the identity framework.
......@@ -34,10 +36,15 @@ namespace DotNetCore.CAP.EntityFrameworkCore
/// </param>
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<CapMessage>(b =>
modelBuilder.Entity<CapSentMessage>(b =>
{
b.HasKey(m => m.Id);
b.ToTable("ConsistencyMessages");
b.Property(p => p.StateName).HasMaxLength(50);
});
modelBuilder.Entity<CapReceivedMessage>(b =>
{
b.Property(p => p.StateName).HasMaxLength(50);
});
}
}
......
......@@ -7,12 +7,7 @@ namespace DotNetCore.CAP.Infrastructure
/// </summary>
public class CapOptions
{
/// <summary>
/// kafka or rabbitMQ brokers connection string.
/// </summary>
public string BrokerUrlList { get; set; } = "localhost:9092";
/// <summary>
/// <summary>
/// Corn expression for configuring retry cron job. Default is 1 min.
/// </summary>
public string CronExp { get; set; } = Cron.Minutely();
......
......@@ -9,8 +9,6 @@
/// Create a new instance of <see cref="IConsumerClient"/>.
/// </summary>
/// <param name="groupId"></param>
/// <param name="clientHostAddress"></param>
/// <returns></returns>
IConsumerClient Create(string groupId, string clientHostAddress);
IConsumerClient Create(string groupId);
}
}
\ No newline at end of file
......@@ -66,7 +66,7 @@ namespace DotNetCore.CAP
{
Task.Factory.StartNew(() =>
{
using (var client = _consumerClientFactory.Create(matchGroup.Key, _options.BrokerUrlList))
using (var client = _consumerClientFactory.Create(matchGroup.Key))
{
client.MessageReceieved += OnMessageReceieved;
......
......@@ -3,7 +3,7 @@
namespace DotNetCore.CAP.Infrastructure
{
/// <summary>
/// The default implementation of <see cref="ConsistencyMessage{TKey}"/> which uses a string as a primary key.
/// cap messages store model.
/// </summary>
public abstract class CapMessage : MessageBase
{
......@@ -36,6 +36,9 @@ namespace DotNetCore.CAP.Infrastructure
public string StateName { get; set; }
}
/// <summary>
/// The message state name.
/// </summary>
public struct StateName
{
public const string Enqueued = nameof(Enqueued);
......
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