From ea5ef4bcfc6a0f6dad8cebab746827224ea5c979 Mon Sep 17 00:00:00 2001 From: Savorboard Date: Thu, 30 Aug 2018 23:18:39 +0800 Subject: [PATCH 01/21] Update README.zh-cn.md --- README.zh-cn.md | 100 ++++++++++++++++++++++++------------------------ 1 file changed, 49 insertions(+), 51 deletions(-) diff --git a/README.zh-cn.md b/README.zh-cn.md index 07bc803..17025fb 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -33,25 +33,21 @@ CAP 采用的是和当前数据库集成的本地消息表的方案来解决在 PM> Install-Package DotNetCore.CAP ``` -如果你的消息队列使用的是 Kafka 的话,你可以: +CAP 支持 Kafka 或者 RabbitMQ 消息队列,你可以选择下面的包进行安装: ``` PM> Install-Package DotNetCore.CAP.Kafka -``` - -如果你的消息队列使用的是 RabbitMQ 的话,你可以: - -``` PM> Install-Package DotNetCore.CAP.RabbitMQ ``` -CAP 提供了 Sql Server, MySql, PostgreSQL 的扩展作为数据库存储: +CAP 提供了 Sql Server, MySql, PostgreSQL,MongoDB 的扩展作为数据库存储: ``` // 按需选择安装你正在使用的数据库 PM> Install-Package DotNetCore.CAP.SqlServer PM> Install-Package DotNetCore.CAP.MySql PM> Install-Package DotNetCore.CAP.PostgreSql +PM> Install-Package DotNetCore.CAP.MongoDB ``` ### Configuration @@ -67,28 +63,23 @@ public void ConfigureServices(IServiceCollection services) services.AddCap(x => { - // 如果你的 SqlServer 使用的 EF 进行数据操作,你需要添加如下配置: - // 注意: 你不需要再次配置 x.UseSqlServer(""") - x.UseEntityFramework(); + //如果你使用的 EF 进行数据操作,你需要添加如下配置: + x.UseEntityFramework(); //可选项,你不需要再次配置 x.UseSqlServer 了 - // 如果你使用的Dapper,你需要添加如下配置: + //如果你使用的Ado.Net,根据数据库选择进行配置: x.UseSqlServer("数据库连接字符串"); + x.UseMySql("Your ConnectionStrings"); + x.UsePostgreSql("Your ConnectionStrings"); - // 如果你使用的 RabbitMQ 作为MQ,你需要添加如下配置: + //如果你使用的 MongoDB,你可以添加如下配置: + x.UseMongoDB("Your ConnectionStrings"); //注意,仅支持MongoDB 4.0+集群 + + //如果你使用的 RabbitMQ 或者 Kafka 作为MQ,根据使用选择配置: x.UseRabbitMQ("localhost"); - - //如果你使用的 Kafka 作为MQ,你需要添加如下配置: x.UseKafka("localhost"); }); } -public void Configure(IApplicationBuilder app) -{ - ..... - - app.UseCap(); -} - ``` ### 发布 @@ -96,39 +87,50 @@ public void Configure(IApplicationBuilder app) 在 Controller 中注入 `ICapPublisher` 然后使用 `ICapPublisher` 进行消息发送 ```c# + public class PublishController : Controller { - [Route("~/checkAccountWithTrans")] - public async Task PublishMessageWithTransaction([FromServices]AppDbContext dbContext, [FromServices]ICapPublisher publisher) + private readonly ICapPublisher _capBus; + + public PublishController(ICapPublisher capPublisher) { - using (var trans = dbContext.Database.BeginTransaction()) - { - // 此处填写你的业务代码 + _capBus = capPublisher; + } + + //不使用事务 + [Route("~/without/transaction")] + public IActionResult WithoutTransaction() + { + _capBus.Publish("xxx.services.show.time", DateTime.Now); + + return Ok(); + } - //如果你使用的是EF,CAP会自动发现当前环境中的事务,所以你不必显式传递事务参数。 - //由于本地事务, 当前数据库的业务操作和发布事件日志之间将实现原子性。 - await publisher.PublishAsync("xxx.services.account.check", new Person { Name = "Foo", Age = 11 }); + //Ado.Net 中使用事务,自动提交 + [Route("~/adonet/transaction")] + public IActionResult AdonetWithTransaction() + { + using (var connection = new MySqlConnection(ConnectionString)) + { + using (var transaction = connection.BeginTransaction(_capBus, autoCommit: true)) + { + //业务代码 - trans.Commit(); + _capBus.Publish("xxx.services.show.time", DateTime.Now); + } } return Ok(); } - [Route("~/publishWithTransactionUsingAdonet")] - public async Task PublishMessageWithTransactionUsingAdonet([FromServices]ICapPublisher publisher) + //EntityFramework 中使用事务,自动提交 + [Route("~/ef/transaction")] + public IActionResult EntityFrameworkWithTransaction([FromServices]AppDbContext dbContext) { - var connectionString = ""; - using (var sqlConnection = new SqlConnection(connectionString)) + using (var trans = dbContext.Database.BeginTransaction(_capBus, autoCommit: true)) { - sqlConnection.Open(); - using (var sqlTransaction = sqlConnection.BeginTransaction()) - { - // 此处填写你的业务代码,通常情况下,你可以将业务代码使用一个委托传递进来进行封装该区域代码。 + //业务代码 - publisher.Publish("xxx.services.account.check", new Person { Name = "Foo", Age = 11 }, sqlTransaction); - - sqlTransaction.Commit(); - } + _capBus.Publish("xxx.services.show.time", DateTime.Now); } return Ok(); } @@ -145,12 +147,10 @@ public class PublishController : Controller ```c# public class PublishController : Controller { - [CapSubscribe("xxx.services.account.check")] - public async Task CheckReceivedMessage(Person person) + [CapSubscribe("xxx.services.show.time")] + public void CheckReceivedMessage(DateTime datetime) { - Console.WriteLine(person.Name); - Console.WriteLine(person.Age); - return Task.CompletedTask; + Console.WriteLine(datetime); } } @@ -169,13 +169,11 @@ namespace xxx.Service public void CheckReceivedMessage(Person person); } - public class SubscriberService: ISubscriberService, ICapSubscribe { - [CapSubscribe("xxx.services.account.check")] - public void CheckReceivedMessage(Person person) + [CapSubscribe("xxx.services.show.time")] + public void CheckReceivedMessage(DateTime datetime) { - } } } From eb15dedb7f336090f2ddf5d62a5465536a37fa9c Mon Sep 17 00:00:00 2001 From: Savorboard Date: Sun, 2 Sep 2018 21:59:45 +0800 Subject: [PATCH 02/21] Delete README.2.2.md --- README.2.2.md | 241 -------------------------------------------------- 1 file changed, 241 deletions(-) delete mode 100644 README.2.2.md diff --git a/README.2.2.md b/README.2.2.md deleted file mode 100644 index 4dbadde..0000000 --- a/README.2.2.md +++ /dev/null @@ -1,241 +0,0 @@ -# CAP                       [中文](https://github.com/dotnetcore/CAP/blob/develop/README.zh-cn.md) -[![Travis branch](https://img.shields.io/travis/dotnetcore/CAP/develop.svg?label=travis-ci)](https://travis-ci.org/dotnetcore/CAP) -[![AppVeyor](https://ci.appveyor.com/api/projects/status/4mpe0tbu7n126vyw?svg=true)](https://ci.appveyor.com/project/yuleyule66/cap) -[![NuGet](https://img.shields.io/nuget/v/DotNetCore.CAP.svg)](https://www.nuget.org/packages/DotNetCore.CAP/) -[![NuGet Preview](https://img.shields.io/nuget/vpre/DotNetCore.CAP.svg?label=nuget-pre)](https://www.nuget.org/packages/DotNetCore.CAP/) -[![Member project of .NET Core Community](https://img.shields.io/badge/member%20project%20of-NCC-9e20c9.svg)](https://github.com/dotnetcore) -[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/dotnetcore/CAP/master/LICENSE.txt) - -CAP is a library based on .Net standard, which is a solution to deal with distributed transactions, also has the function of EventBus, it is lightweight, easy to use, and efficiently. - -## OverView - -In the process of building an SOA or MicroService system, we usually need to use the event to integrate each services. In the process, the simple use of message queue does not guarantee the reliability. CAP is adopted the local message table program integrated with the current database to solve the exception may occur in the process of the distributed system calling each other. It can ensure that the event messages are not lost in any case. - -You can also use the CAP as an EventBus. The CAP provides a simpler way to implement event publishing and subscriptions. You do not need to inherit or implement any interface during the process of subscription and sending. - -This is a diagram of the CAP working in the ASP.NET Core MicroService architecture: - -![](http://images2015.cnblogs.com/blog/250417/201707/250417-20170705175827128-1203291469.png) - -> The solid line in the figure represents the user code, and the dotted line represents the internal implementation of the CAP. - -## Getting Started - -### NuGet - -You can run the following command to install the CAP in your project. - -``` -PM> Install-Package DotNetCore.CAP -``` - -If you want use Kafka to send integrating event, installing by: - -``` -PM> Install-Package DotNetCore.CAP.Kafka -``` - -If you want use RabbitMQ to send integrating event, installing by: - -``` -PM> Install-Package DotNetCore.CAP.RabbitMQ -``` - -CAP supports SqlServer, MySql, PostgreSql as event log storage. - -``` - -// select a database provider you are using, event log table will integrate into. - -PM> Install-Package DotNetCore.CAP.SqlServer -PM> Install-Package DotNetCore.CAP.MySql -PM> Install-Package DotNetCore.CAP.PostgreSql -``` - -### Configuration - -First,You need to config CAP in your Startup.cs: - -```cs -public void ConfigureServices(IServiceCollection services) -{ - //...... - - services.AddDbContext(); - - services.AddCap(x => - { - // If you are using EF, you need to add the following configuration: - // Notice: You don't need to config x.UseSqlServer(""") again! CAP can autodiscovery. - x.UseEntityFramework(); - - // If you are using ado.net,you need to add the configuration: - x.UseSqlServer("Your ConnectionStrings"); - x.UseMySql("Your ConnectionStrings"); - x.UsePostgreSql("Your ConnectionStrings"); - - // If you are using RabbitMQ, you need to add the configuration: - x.UseRabbitMQ("localhost"); - - // If you are using Kafka, you need to add the configuration: - x.UseKafka("localhost"); - }); -} - -public void Configure(IApplicationBuilder app) -{ - //..... - - app.UseCap(); -} - -``` - -### Publish - -Inject `ICapPublisher` in your Controller, then use the `ICapPublisher` to send message - -```c# -public class PublishController : Controller -{ - [Route("~/publishWithTransactionUsingEF")] - public async Task PublishMessageWithTransactionUsingEF([FromServices]AppDbContext dbContext, [FromServices]ICapPublisher publisher) - { - using (var trans = dbContext.Database.BeginTransaction()) - { - // your business code - - //If you are using EF, CAP will automatic discovery current environment transaction, so you do not need to explicit pass parameters. - //Achieving atomicity between original database operation and the publish event log thanks to a local transaction. - await publisher.PublishAsync("xxx.services.account.check", new Person { Name = "Foo", Age = 11 }); - - trans.Commit(); - } - return Ok(); - } - - [Route("~/publishWithTransactionUsingAdonet")] - public async Task PublishMessageWithTransactionUsingAdonet([FromServices]ICapPublisher publisher) - { - var connectionString = ""; - using (var sqlConnection = new SqlConnection(connectionString)) - { - sqlConnection.Open(); - using (var sqlTransaction = sqlConnection.BeginTransaction()) - { - // your business code - - publisher.Publish("xxx.services.account.check", new Person { Name = "Foo", Age = 11 }, sqlTransaction); - - sqlTransaction.Commit(); - } - } - return Ok(); - } -} - -``` - -### Subscribe - -**Action Method** - -Add the Attribute `[CapSubscribe()]` on Action to subscribe message: - -```c# -public class PublishController : Controller -{ - [CapSubscribe("xxx.services.account.check")] - public async Task CheckReceivedMessage(Person person) - { - Console.WriteLine(person.Name); - Console.WriteLine(person.Age); - return Task.CompletedTask; - } -} - -``` - -**Service Method** - -If your subscribe method is not in the Controller,then your subscribe class need to Inheritance `ICapSubscribe`: - -```c# - -namespace xxx.Service -{ - public interface ISubscriberService - { - public void CheckReceivedMessage(Person person); - } - - - public class SubscriberService: ISubscriberService, ICapSubscribe - { - [CapSubscribe("xxx.services.account.check")] - public void CheckReceivedMessage(Person person) - { - } - } -} - -``` - -Then inject your `ISubscriberService` class in Startup.cs - -```c# -public void ConfigureServices(IServiceCollection services) -{ - //Note: The injection of services needs before of `services.AddCap()` - services.AddTransient(); - - services.AddCap(x=>{}); -} -``` - -### Dashboard - -CAP 2.1 and above provides the dashboard pages, you can easily view the sent and received messages. In addition, you can also view the message status in real time on the dashboard. - -In the distributed environment, the dashboard built-in integrated [Consul](http://consul.io) as a node discovery, while the realization of the gateway agent function, you can also easily view the node or other node data, It's like you are visiting local resources. - -```c# -services.AddCap(x => -{ - //... - - // Register Dashboard - x.UseDashboard(); - - // Register to Consul - x.UseDiscovery(d => - { - d.DiscoveryServerHostName = "localhost"; - d.DiscoveryServerPort = 8500; - d.CurrentNodeHostName = "localhost"; - d.CurrentNodePort = 5800; - d.NodeId = 1; - d.NodeName = "CAP No.1 Node"; - }); -}); -``` - -The default dashboard address is :[http://localhost:xxx/cap](http://localhost:xxx/cap) , you can also change the `cap` suffix to others with `d.MatchPath` configuration options. - -![dashboard](http://images2017.cnblogs.com/blog/250417/201710/250417-20171004220827302-189215107.png) - -![received](http://images2017.cnblogs.com/blog/250417/201710/250417-20171004220934115-1107747665.png) - -![subscibers](http://images2017.cnblogs.com/blog/250417/201710/250417-20171004220949193-884674167.png) - -![nodes](http://images2017.cnblogs.com/blog/250417/201710/250417-20171004221001880-1162918362.png) - - -## Contribute - -One of the easiest ways to contribute is to participate in discussions and discuss issues. You can also contribute by submitting pull requests with code changes. - -### License - -[MIT](https://github.com/dotnetcore/CAP/blob/master/LICENSE.txt) From e993f4be927a993c3d1abd21d58085625e953355 Mon Sep 17 00:00:00 2001 From: Savorboard Date: Fri, 7 Sep 2018 18:10:48 +0800 Subject: [PATCH 03/21] Fix flush unclaer data bugs. --- src/DotNetCore.CAP/ICapTransaction.Base.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/DotNetCore.CAP/ICapTransaction.Base.cs b/src/DotNetCore.CAP/ICapTransaction.Base.cs index 141a300..ebf002e 100644 --- a/src/DotNetCore.CAP/ICapTransaction.Base.cs +++ b/src/DotNetCore.CAP/ICapTransaction.Base.cs @@ -23,13 +23,15 @@ namespace DotNetCore.CAP { _bufferList.Add(msg); } - - protected void Flush() + + protected virtual void Flush() { foreach (var message in _bufferList) { _dispatcher.EnqueueToPublish(message); } + + _bufferList.Clear(); } public abstract void Commit(); From 4a5695c2188dc1e55b679c07c283e4eb60e3ed58 Mon Sep 17 00:00:00 2001 From: Savorboard Date: Fri, 7 Sep 2018 22:16:31 +0800 Subject: [PATCH 04/21] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3839343..c7ff726 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ CAP is a library based on .Net standard, which is a solution to deal with distributed transactions, also has the function of EventBus, it is lightweight, easy to use, and efficiently. -## OverView +## Overview In the process of building an SOA or MicroService system, we usually need to use the event to integrate each services. In the process, the simple use of message queue does not guarantee the reliability. CAP is adopted the local message table program integrated with the current database to solve the exception may occur in the process of the distributed system calling each other. It can ensure that the event messages are not lost in any case. @@ -18,6 +18,8 @@ This is a diagram of the CAP working in the ASP.NET Core MicroService architectu ![cap.png](http://oowr92l0m.bkt.clouddn.com/cap.png) +> CAP implements the Outbox Pttern described in the [eShop ebook](https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/multi-container-microservice-net-applications/subscribe-events#designing-atomicity-and-resiliency-when-publishing-to-the-event-bus) + ## Getting Started ### NuGet From c00f77e73af80691a87b75e54c70173d6ab03014 Mon Sep 17 00:00:00 2001 From: Savorboard Date: Fri, 7 Sep 2018 22:29:24 +0800 Subject: [PATCH 05/21] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c7ff726..05ed9bf 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ This is a diagram of the CAP working in the ASP.NET Core MicroService architectu ![cap.png](http://oowr92l0m.bkt.clouddn.com/cap.png) -> CAP implements the Outbox Pttern described in the [eShop ebook](https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/multi-container-microservice-net-applications/subscribe-events#designing-atomicity-and-resiliency-when-publishing-to-the-event-bus) +> CAP implements the Outbox Pattern described in the [eShop ebook](https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/multi-container-microservice-net-applications/subscribe-events#designing-atomicity-and-resiliency-when-publishing-to-the-event-bus) ## Getting Started From 2379760dca212ce6d6f8953fc63f7ca1a91982c6 Mon Sep 17 00:00:00 2001 From: Savorboard Date: Fri, 7 Sep 2018 22:31:06 +0800 Subject: [PATCH 06/21] Update README.zh-cn.md --- README.zh-cn.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.zh-cn.md b/README.zh-cn.md index 17025fb..2713cee 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -19,9 +19,9 @@ CAP 采用的是和当前数据库集成的本地消息表的方案来解决在 这是CAP集在ASP.NET Core 微服务架构中的一个示意图: -![](http://images2015.cnblogs.com/blog/250417/201707/250417-20170705175827128-1203291469.png) +![cap.png](http://oowr92l0m.bkt.clouddn.com/cap.png) -> 图中实线部分代表用户代码,虚线部分代表CAP内部实现。 +> CAP 实现了 [eShop 电子书](https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/multi-container-microservice-net-applications/subscribe-events#designing-atomicity-and-resiliency-when-publishing-to-the-event-bus) 中描述的发件箱模式 ## Getting Started From 902fa63be687901ee4e9f0264bf3c3cce6f3b497 Mon Sep 17 00:00:00 2001 From: Savorboard Date: Fri, 7 Sep 2018 23:25:34 +0800 Subject: [PATCH 07/21] update readme.md to add the subscriber group descriptions. --- README.md | 46 ++++++++++++++++++++++++++++++++++++++++------ README.zh-cn.md | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 05ed9bf..9ffc9d2 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ This is a diagram of the CAP working in the ASP.NET Core MicroService architectu ![cap.png](http://oowr92l0m.bkt.clouddn.com/cap.png) -> CAP implements the Outbox Pattern described in the [eShop ebook](https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/multi-container-microservice-net-applications/subscribe-events#designing-atomicity-and-resiliency-when-publishing-to-the-event-bus) +> CAP implements the Outbox Pattern described in the [eShop ebook](https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/multi-container-microservice-net-applications/subscribe-events#designing-atomicity-and-resiliency-when-publishing-to-the-event-bus). ## Getting Started @@ -65,7 +65,7 @@ public void ConfigureServices(IServiceCollection services) // If you are using EF, you need to add the configuration: x.UseEntityFramework(); //Options, Notice: You don't need to config x.UseSqlServer(""") again! CAP can autodiscovery. - // If you are using Ado.Net, you need to add the configuration: + // If you are using Dapper, you need to add the configuration: x.UseSqlServer("Your ConnectionStrings"); x.UseMySql("Your ConnectionStrings"); x.UsePostgreSql("Your ConnectionStrings"); @@ -131,7 +131,7 @@ public class PublishController : Controller ### Subscribe -**Action Method** +**In Action Method** Add the Attribute `[CapSubscribe()]` on Action to subscribe message: @@ -147,17 +147,17 @@ public class PublishController : Controller ``` -**Service Method** +**In Service Method** If your subscribe method is not in the Controller,then your subscribe class need to Inheritance `ICapSubscribe`: ```c# -namespace xxx.Service +namespace BusinessCode.Service { public interface ISubscriberService { - public void CheckReceivedMessage(Person person); + public void CheckReceivedMessage(DateTime person); } public class SubscriberService: ISubscriberService, ICapSubscribe @@ -183,6 +183,40 @@ public void ConfigureServices(IServiceCollection services) } ``` +#### Subscribe Group + +The concept of a subscription group is similar to that of a consumer group in Kafka. it is the same as the broadcast mode in the message queue, which is used to process the same message between multiple different microservice instances. + +When CAP startup, it will use the current assembly name as the default group name, if multiple same group subscribers subscribe the same topic name, there is only one subscriber can receive the message. +Conversely, if subscribers are in different groups, they will all receive messages. + +In the same application, you can specify the `Group` property to keep they are in different consumer groups: + +```C# + +[CapSubscribe("xxx.services.show.time", Group = "group1" )] +public void ShowTime1(DateTime datetime) +{ +} + +[CapSubscribe("xxx.services.show.time", Group = "group2")] +public void ShowTime2(DateTime datetime) +{ +} + +``` +`ShowTime1` and `ShowTime2` will be called at the same time. + +BTW, You can specify the default group name in the configuration : + +```C# +services.AddCap(x => +{ + x.DefaultGroup = "default-group-name"; +}); + +``` + ### Dashboard CAP v2.1+ provides the dashboard pages, you can easily view the sent and received messages. In addition, you can also view the message status in real time on the dashboard. diff --git a/README.zh-cn.md b/README.zh-cn.md index 2713cee..2b8624f 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -192,6 +192,42 @@ public void ConfigureServices(IServiceCollection services) } ``` + +#### 订阅者组 + +订阅者组的概念类似于 Kafka 中的消费者组,它和消息队列中的广播模式相同,用来处理不同微服务实例之间同时消费相同的消息。 + +当CAP启动的时候,她将创建一个默认的消费者组,如果多个相同消费者组的消费者消费同一个Topic消息的时候,只会有一个消费者被执行。 +相反,如果消费者都位于不同的消费者组,则所有的消费者都会被执行。 + +相同的实例中,你可以通过下面的方式来指定他们位于不同的消费者组。 + +```C# + +[CapSubscribe("xxx.services.show.time", Group = "group1" )] +public void ShowTime1(DateTime datetime) +{ +} + +[CapSubscribe("xxx.services.show.time", Group = "group2")] +public void ShowTime2(DateTime datetime) +{ +} + +``` +`ShowTime1` and `ShowTime2` are In different groups, they will be called at the same time. + +BTW, You can specify the default group name in the configuration : + +```C# +services.AddCap(x => +{ + x.DefaultGroup = "default-group-name"; +}); + +``` + + ### Dashboard CAP 2.1+ 以上版本中提供了仪表盘(Dashboard)功能,你可以很方便的查看发出和接收到的消息。除此之外,你还可以在仪表盘中实时查看发送或者接收到的消息。 From 83cca80f9d1203eb8be26c848da2d73db8a725bc Mon Sep 17 00:00:00 2001 From: Savorboard Date: Fri, 7 Sep 2018 23:28:05 +0800 Subject: [PATCH 08/21] update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9ffc9d2..e991c05 100644 --- a/README.md +++ b/README.md @@ -190,7 +190,7 @@ The concept of a subscription group is similar to that of a consumer group in Ka When CAP startup, it will use the current assembly name as the default group name, if multiple same group subscribers subscribe the same topic name, there is only one subscriber can receive the message. Conversely, if subscribers are in different groups, they will all receive messages. -In the same application, you can specify the `Group` property to keep they are in different consumer groups: +In the same application, you can specify the `Group` property to keep they are in different subscribe groups: ```C# From 800df06877a66904408431a6aaedc7e767ac906b Mon Sep 17 00:00:00 2001 From: Savorboard Date: Mon, 10 Sep 2018 11:20:59 +0800 Subject: [PATCH 09/21] update version to 2.3.1 --- build/version.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/version.props b/build/version.props index 5f50de5..e9ad11c 100644 --- a/build/version.props +++ b/build/version.props @@ -2,7 +2,7 @@ 2 3 - 0 + 1 $(VersionMajor).$(VersionMinor).$(VersionPatch) From 7644344d0f7d87a842a1721d5d49f008e4da1153 Mon Sep 17 00:00:00 2001 From: Savorboard Date: Tue, 11 Sep 2018 11:01:26 +0800 Subject: [PATCH 10/21] add SnowflakeId unit tests --- test/DotNetCore.CAP.Test/SnowflakeIdTest.cs | 35 +++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 test/DotNetCore.CAP.Test/SnowflakeIdTest.cs diff --git a/test/DotNetCore.CAP.Test/SnowflakeIdTest.cs b/test/DotNetCore.CAP.Test/SnowflakeIdTest.cs new file mode 100644 index 0000000..46553cf --- /dev/null +++ b/test/DotNetCore.CAP.Test/SnowflakeIdTest.cs @@ -0,0 +1,35 @@ +using System.Linq; +using System.Threading.Tasks; +using DotNetCore.CAP.Infrastructure; +using Xunit; + +namespace DotNetCore.CAP.Test +{ + public class SnowflakeIdTest + { + [Fact] + public void NextIdTest() + { + var result = SnowflakeId.Default().NextId(); + + Assert.IsType(result); + Assert.True(result > 0); + Assert.True(result.ToString().Length == long.MaxValue.ToString().Length); + } + + [Fact] + public void ConcurrentNextIdTest() + { + var array = new long[1000]; + + Parallel.For(0, 1000, i => + { + var id = SnowflakeId.Default().NextId(); + array[i] = id; + }); + + Assert.True(array.Distinct().Count() == 1000); + } + + } +} From 6e0c8800350d01bdbb27eb65d32a5fafa4a07431 Mon Sep 17 00:00:00 2001 From: Savorboard Date: Wed, 12 Sep 2018 11:12:08 +0800 Subject: [PATCH 11/21] update build.cake for unit test adjustment --- build.cake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build.cake b/build.cake index 1b68025..a355f8d 100644 --- a/build.cake +++ b/build.cake @@ -55,9 +55,15 @@ Task("Test") .IsDependentOn("Build") .Does(() => { + var settings = new DotNetCoreTestSettings + { + Configuration = build.Configuration, + NoBuild = false + }; + foreach (var testProject in build.TestProjectFiles) { - DotNetCoreTest(testProject.FullPath); + DotNetCoreTest(testProject.FullPath, settings); } }); From 2e1fd306e081f953a565efffb6b45aafe3fb33d8 Mon Sep 17 00:00:00 2001 From: Savorboard Date: Wed, 12 Sep 2018 11:12:25 +0800 Subject: [PATCH 12/21] remove unused config file --- .gitattributes | 51 --------- .github/ISSUE_TEMPLATE | 2 +- CAP.sln | 5 - CAP.vssettings | 230 ----------------------------------------- 4 files changed, 1 insertion(+), 287 deletions(-) delete mode 100644 .gitattributes delete mode 100644 CAP.vssettings diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 66abdf2..0000000 --- a/.gitattributes +++ /dev/null @@ -1,51 +0,0 @@ -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain - -*.jpg binary -*.png binary -*.gif binary - -*.cs text=auto diff=csharp -*.vb text=auto -*.resx text=auto -*.c text=auto -*.cpp text=auto -*.cxx text=auto -*.h text=auto -*.hxx text=auto -*.py text=auto -*.rb text=auto -*.java text=auto -*.html text=auto -*.htm text=auto -*.css text=auto -*.scss text=auto -*.sass text=auto -*.less text=auto -*.js text=auto -*.lisp text=auto -*.clj text=auto -*.sql text=auto -*.php text=auto -*.lua text=auto -*.m text=auto -*.asm text=auto -*.erl text=auto -*.fs text=auto -*.fsx text=auto -*.hs text=auto - -*.csproj text=auto -*.vbproj text=auto -*.fsproj text=auto -*.dbproj text=auto -*.sln text=auto eol=crlf -*.sh eol=lf \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE b/.github/ISSUE_TEMPLATE index 66cdc24..9a81a5a 100644 --- a/.github/ISSUE_TEMPLATE +++ b/.github/ISSUE_TEMPLATE @@ -11,7 +11,7 @@ Thank you for reporting an issue. 2. 我们推荐如果是小问题(错别字修改,小的 bug fix)直接提交 PR。 3. 如果是一个新需求,请提供:详细需求描述,最好是有伪代码实现。 4. 如果是一个 BUG,请提供:复现步骤,错误日志以及相关配置,并尽量填写下面的模板中的条目。 -6. 扩展阅读:[如何向开源项目提交无法解答的问题](https://zhuanlan.zhihu.com/p/25795393) +6. 如果可能,请使用【英文】来提交你的问题。 --> Please answer these questions before submitting your issue. diff --git a/CAP.sln b/CAP.sln index 8fc6b2f..e87e109 100644 --- a/CAP.sln +++ b/CAP.sln @@ -9,14 +9,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{C09CDAB0-6 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{57A8A8E5-5715-41BF-A0A6-46B819933FBC}" ProjectSection(SolutionItems) = preProject - .gitattributes = .gitattributes .gitignore = .gitignore .travis.yml = .travis.yml appveyor.yml = appveyor.yml - CAP.vssettings = CAP.vssettings - CHANGELOG.md = CHANGELOG.md - CODE_OF_CONDUCT.md = CODE_OF_CONDUCT.md - ConfigureMSDTC.ps1 = ConfigureMSDTC.ps1 .github\ISSUE_TEMPLATE = .github\ISSUE_TEMPLATE LICENSE.txt = LICENSE.txt README.md = README.md diff --git a/CAP.vssettings b/CAP.vssettings deleted file mode 100644 index aa71084..0000000 --- a/CAP.vssettings +++ /dev/null @@ -1,230 +0,0 @@ -falsetruetruefalsetruefalsetruetruetrue00truetruetruefalse56553510truetruetruetruefalsetrue10%vsspv_visualstudio_dir%\Projectstruefalsetrue44true%vsspv_visualstudio_dir%\Templates\ItemTemplatestruetrue201%vsspv_visualstudio_dir%\Templates\ProjectTemplatestrue4truetruefalsetruetruetruetruetrue5true60falseHACK:2TODO:2UNDONE:2UnresolvedMergeConflict:3falsefalsehttps://go.microsoft.com/fwlink/?LinkId=36599&clcid=%vsspv_lcid_hex%1%systemroot%\system32\notepad.exehttps://go.microsoft.com/fwlink/?LinkId=32722&clcid=%vsspv_lcid_hex%01014truetruetruetrue2truefalsetruefalsefalsetruetruefalsetruetruetrue58truefalse4truetruetruetrue<CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" /><CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Hidden" />true0truetruefalsefalsetruetrue<CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" />false<CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Hidden" />truefalsetruetruetruetrue<CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" /><CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" />true4truetruetruetrue2truetruetruefalsefalsetruetruetruetruetruetrue58truefalse4truetruetruetrue2truetrue10truefalse2truetruefalsefalse0true2falsetruefalse2truefalsefalsetruetruefalse1truetruefalse0falsetruefalsefalsefalsefalse{}[]().,:;+-*/%&|^!=<>?@#\truefalse0truefalsetruefalsefalsefalsetruefalsetruetrue0truetruefalsefalsefalsefalsetruefalse5120falsefalse2falsefalsefalsefalsefalsefalsetruefalsetruefalsefalsetruefalsetruefalsefalse1truefalse5falsetruetruetruefalsefalse0falsefalsetruetrue3falsefalsefalse60falsefalsetruefalsefalse2falsefalsetruetruefalsefalsefalsetrue55falsetruetruetruetruetruefalsefalsetruefalsefalsetruetruetruefalsefalsetruetruefalse1truefalsefalsefalsefalsefalsefalse0falsefalsetrue2falsefalse4truetruetruetrue2truetruetruefalsefalsetruetruefalsetruetruetrue58truefalse4truetruetruetrue1111<CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" /><CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" /><CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Hidden" />111100111011011110000<CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" />00010<CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" /><NamingPreferencesInfo SerializationVersion="4"> - <SymbolSpecifications> - <SymbolSpecification ID="5c545a62-b14d-460a-88d8-e936c0a39316" Name="Class"> - <ApplicableSymbolKindList> - <TypeKind>Class</TypeKind> - </ApplicableSymbolKindList> - <ApplicableAccessibilityList> - <AccessibilityKind>Public</AccessibilityKind> - <AccessibilityKind>Internal</AccessibilityKind> - <AccessibilityKind>Private</AccessibilityKind> - <AccessibilityKind>Protected</AccessibilityKind> - <AccessibilityKind>ProtectedOrInternal</AccessibilityKind> - </ApplicableAccessibilityList> - <RequiredModifierList /> - </SymbolSpecification> - <SymbolSpecification ID="23d856b4-5089-4405-83ce-749aada99153" Name="Interface"> - <ApplicableSymbolKindList> - <TypeKind>Interface</TypeKind> - </ApplicableSymbolKindList> - <ApplicableAccessibilityList> - <AccessibilityKind>Public</AccessibilityKind> - <AccessibilityKind>Internal</AccessibilityKind> - <AccessibilityKind>Private</AccessibilityKind> - <AccessibilityKind>Protected</AccessibilityKind> - <AccessibilityKind>ProtectedOrInternal</AccessibilityKind> - </ApplicableAccessibilityList> - <RequiredModifierList /> - </SymbolSpecification> - <SymbolSpecification ID="d1796e78-ff66-463f-8576-eb46416060c0" Name="Struct"> - <ApplicableSymbolKindList> - <TypeKind>Struct</TypeKind> - </ApplicableSymbolKindList> - <ApplicableAccessibilityList> - <AccessibilityKind>Public</AccessibilityKind> - <AccessibilityKind>Internal</AccessibilityKind> - <AccessibilityKind>Private</AccessibilityKind> - <AccessibilityKind>Protected</AccessibilityKind> - <AccessibilityKind>ProtectedOrInternal</AccessibilityKind> - </ApplicableAccessibilityList> - <RequiredModifierList /> - </SymbolSpecification> - <SymbolSpecification ID="d8af8dc6-1ade-441d-9947-8946922e198a" Name="Enum"> - <ApplicableSymbolKindList> - <TypeKind>Enum</TypeKind> - </ApplicableSymbolKindList> - <ApplicableAccessibilityList> - <AccessibilityKind>Public</AccessibilityKind> - <AccessibilityKind>Internal</AccessibilityKind> - <AccessibilityKind>Private</AccessibilityKind> - <AccessibilityKind>Protected</AccessibilityKind> - <AccessibilityKind>ProtectedOrInternal</AccessibilityKind> - </ApplicableAccessibilityList> - <RequiredModifierList /> - </SymbolSpecification> - <SymbolSpecification ID="408a3347-b908-4b54-a954-1355e64c1de3" Name="Delegate"> - <ApplicableSymbolKindList> - <TypeKind>Delegate</TypeKind> - </ApplicableSymbolKindList> - <ApplicableAccessibilityList> - <AccessibilityKind>Public</AccessibilityKind> - <AccessibilityKind>Internal</AccessibilityKind> - <AccessibilityKind>Private</AccessibilityKind> - <AccessibilityKind>Protected</AccessibilityKind> - <AccessibilityKind>ProtectedOrInternal</AccessibilityKind> - </ApplicableAccessibilityList> - <RequiredModifierList /> - </SymbolSpecification> - <SymbolSpecification ID="830657f6-e7e5-4830-b328-f109d3b6c165" Name="Event"> - <ApplicableSymbolKindList> - <SymbolKind>Event</SymbolKind> - </ApplicableSymbolKindList> - <ApplicableAccessibilityList> - <AccessibilityKind>Public</AccessibilityKind> - <AccessibilityKind>Internal</AccessibilityKind> - <AccessibilityKind>Private</AccessibilityKind> - <AccessibilityKind>Protected</AccessibilityKind> - <AccessibilityKind>ProtectedOrInternal</AccessibilityKind> - </ApplicableAccessibilityList> - <RequiredModifierList /> - </SymbolSpecification> - <SymbolSpecification ID="390caed4-f0a9-42bb-adbb-b44c4a302a22" Name="Method"> - <ApplicableSymbolKindList> - <SymbolKind>Method</SymbolKind> - </ApplicableSymbolKindList> - <ApplicableAccessibilityList> - <AccessibilityKind>Public</AccessibilityKind> - </ApplicableAccessibilityList> - <RequiredModifierList /> - </SymbolSpecification> - <SymbolSpecification ID="af410767-f189-47c6-b140-aeccf1ff242e" Name="Private Method"> - <ApplicableSymbolKindList> - <SymbolKind>Method</SymbolKind> - </ApplicableSymbolKindList> - <ApplicableAccessibilityList> - <AccessibilityKind>Private</AccessibilityKind> - </ApplicableAccessibilityList> - <RequiredModifierList /> - </SymbolSpecification> - <SymbolSpecification ID="8076757e-6a4a-47f1-9b4b-ae8a3284e987" Name="Abstract Method"> - <ApplicableSymbolKindList> - <SymbolKind>Method</SymbolKind> - </ApplicableSymbolKindList> - <ApplicableAccessibilityList> - <AccessibilityKind>Public</AccessibilityKind> - <AccessibilityKind>Internal</AccessibilityKind> - <AccessibilityKind>Private</AccessibilityKind> - <AccessibilityKind>Protected</AccessibilityKind> - <AccessibilityKind>ProtectedOrInternal</AccessibilityKind> - </ApplicableAccessibilityList> - <RequiredModifierList> - <ModifierKind>IsAbstract</ModifierKind> - </RequiredModifierList> - </SymbolSpecification> - <SymbolSpecification ID="16133061-a8e7-4392-92c3-1d93cd54c218" Name="Static Method"> - <ApplicableSymbolKindList> - <SymbolKind>Method</SymbolKind> - </ApplicableSymbolKindList> - <ApplicableAccessibilityList> - <AccessibilityKind>Public</AccessibilityKind> - <AccessibilityKind>Internal</AccessibilityKind> - <AccessibilityKind>Private</AccessibilityKind> - <AccessibilityKind>Protected</AccessibilityKind> - <AccessibilityKind>ProtectedOrInternal</AccessibilityKind> - </ApplicableAccessibilityList> - <RequiredModifierList> - <ModifierKind>IsStatic</ModifierKind> - </RequiredModifierList> - </SymbolSpecification> - <SymbolSpecification ID="da6a2919-5aa6-4ad1-a24d-576776ed3974" Name="Property"> - <ApplicableSymbolKindList> - <SymbolKind>Property</SymbolKind> - </ApplicableSymbolKindList> - <ApplicableAccessibilityList> - <AccessibilityKind>Public</AccessibilityKind> - <AccessibilityKind>Internal</AccessibilityKind> - <AccessibilityKind>Private</AccessibilityKind> - <AccessibilityKind>Protected</AccessibilityKind> - <AccessibilityKind>ProtectedOrInternal</AccessibilityKind> - </ApplicableAccessibilityList> - <RequiredModifierList /> - </SymbolSpecification> - <SymbolSpecification ID="b24a91ce-3501-4799-b6df-baf044156c83" Name="Public or Protected Field"> - <ApplicableSymbolKindList> - <SymbolKind>Field</SymbolKind> - </ApplicableSymbolKindList> - <ApplicableAccessibilityList> - <AccessibilityKind>Public</AccessibilityKind> - <AccessibilityKind>Protected</AccessibilityKind> - </ApplicableAccessibilityList> - <RequiredModifierList /> - </SymbolSpecification> - <SymbolSpecification ID="70af42cb-1741-4027-969c-9edc4877d965" Name="Static Field"> - <ApplicableSymbolKindList> - <SymbolKind>Field</SymbolKind> - </ApplicableSymbolKindList> - <ApplicableAccessibilityList> - <AccessibilityKind>Public</AccessibilityKind> - <AccessibilityKind>Internal</AccessibilityKind> - <AccessibilityKind>Private</AccessibilityKind> - <AccessibilityKind>Protected</AccessibilityKind> - <AccessibilityKind>ProtectedOrInternal</AccessibilityKind> - </ApplicableAccessibilityList> - <RequiredModifierList> - <ModifierKind>IsStatic</ModifierKind> - </RequiredModifierList> - </SymbolSpecification> - <SymbolSpecification ID="10790aa6-0a0b-432d-a52d-d252ca92302b" Name="Private or Internal Field"> - <ApplicableSymbolKindList> - <SymbolKind>Field</SymbolKind> - </ApplicableSymbolKindList> - <ApplicableAccessibilityList> - <AccessibilityKind>Internal</AccessibilityKind> - <AccessibilityKind>Private</AccessibilityKind> - </ApplicableAccessibilityList> - <RequiredModifierList /> - </SymbolSpecification> - <SymbolSpecification ID="ac995be4-88de-4771-9dcc-a456a7c02d89" Name="Private or Internal Static Field"> - <ApplicableSymbolKindList> - <SymbolKind>Field</SymbolKind> - </ApplicableSymbolKindList> - <ApplicableAccessibilityList> - <AccessibilityKind>Internal</AccessibilityKind> - <AccessibilityKind>Private</AccessibilityKind> - </ApplicableAccessibilityList> - <RequiredModifierList> - <ModifierKind>IsStatic</ModifierKind> - </RequiredModifierList> - </SymbolSpecification> - <SymbolSpecification ID="2c07f5bf-bc81-4c2b-82b4-ae9b3ffd0ba4" Name="Types"> - <ApplicableSymbolKindList> - <TypeKind>Class</TypeKind> - <TypeKind>Struct</TypeKind> - <TypeKind>Interface</TypeKind> - <TypeKind>Enum</TypeKind> - </ApplicableSymbolKindList> - <ApplicableAccessibilityList> - <AccessibilityKind>Public</AccessibilityKind> - <AccessibilityKind>Internal</AccessibilityKind> - <AccessibilityKind>Private</AccessibilityKind> - <AccessibilityKind>Protected</AccessibilityKind> - <AccessibilityKind>ProtectedOrInternal</AccessibilityKind> - </ApplicableAccessibilityList> - <RequiredModifierList /> - </SymbolSpecification> - <SymbolSpecification ID="5f3ddba1-279f-486c-801e-5c097c36dd85" Name="Non-Field Members"> - <ApplicableSymbolKindList> - <SymbolKind>Property</SymbolKind> - <SymbolKind>Method</SymbolKind> - <SymbolKind>Event</SymbolKind> - </ApplicableSymbolKindList> - <ApplicableAccessibilityList> - <AccessibilityKind>Public</AccessibilityKind> - <AccessibilityKind>Internal</AccessibilityKind> - <AccessibilityKind>Private</AccessibilityKind> - <AccessibilityKind>Protected</AccessibilityKind> - <AccessibilityKind>ProtectedOrInternal</AccessibilityKind> - </ApplicableAccessibilityList> - <RequiredModifierList /> - </SymbolSpecification> - </SymbolSpecifications> - <NamingStyles> - <NamingStyle ID="87e7c501-9948-4b53-b1eb-a6cbe918feee" Name="Pascal Case" Prefix="" Suffix="" WordSeparator="" CapitalizationScheme="PascalCase" /> - <NamingStyle ID="1ecc5eb6-b5fc-49a5-a9f1-a980f3e48c92" Name="Begins with I" Prefix="I" Suffix="" WordSeparator="" CapitalizationScheme="PascalCase" /> - </NamingStyles> - <NamingRules> - <SerializableNamingRule SymbolSpecificationID="23d856b4-5089-4405-83ce-749aada99153" NamingStyleID="1ecc5eb6-b5fc-49a5-a9f1-a980f3e48c92" EnforcementLevel="Info" /> - <SerializableNamingRule SymbolSpecificationID="2c07f5bf-bc81-4c2b-82b4-ae9b3ffd0ba4" NamingStyleID="87e7c501-9948-4b53-b1eb-a6cbe918feee" EnforcementLevel="Info" /> - <SerializableNamingRule SymbolSpecificationID="5f3ddba1-279f-486c-801e-5c097c36dd85" NamingStyleID="87e7c501-9948-4b53-b1eb-a6cbe918feee" EnforcementLevel="Info" /> - </NamingRules> -</NamingPreferencesInfo>10011111-1-1<CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Hidden" />012110000011010011121<CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" />011<CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" /><CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" />01101100010114truetruetruetrue2truetruetruefalsefalsetruetruefalsetruetruetrue58truefalse4truetruetruetruetruetrue0truetruefalsetruefalsetruetrue4truetruetruetrue2truetruefalsefalsefalsetruetruefalsetruetruetrue58truefalse4truetruetruetrue16244681013027014130030571648769114413810003575607202202157245271502431557746900202000-1-17257087123839990128jpg080gif99915000-12083886085-1750-11317273516765887200-1-104294967295201001128954521521676031116750848210033012865075201800-114145511216768975072570870text/html;text/x-jquery-tmpl;text/template;text/x-handlebars;text/x-handlebars-template;text/x-jsrender1673925816777215090HTML5010500-120111190170100112167508481200-14truetruetruetrue2truetruetruefalsefalsetruetruefalsetruetruetrue58truefalse4truetruetruetrue4truetruetruetrue2truetruetruefalsefalsetruetruetruefalsetruetrue58falsefalse4falsetruetruetrue4truetruetruetrue2truetruetruefalsefalsetruetruefalsetruetruetrue58truefalse4truetruetruetrueImplicit (Windows)|$(VSInstallDir)\JavaScript\References\libhelp.js|$(VSInstallDir)\JavaScript\References\domWindows.js|$(VSInstallDir)\JavaScript\References\underscorefilter.js|$(VSInstallDir)\JavaScript\References\showPlainComments.js;Implicit (Windows 8.1)|$(VSInstallDir)\JavaScript\References\libhelp.js|$(VSInstallDir)\JavaScript\References\sitetypesWindows.js|$(VSInstallDir)\JavaScript\References\domWindows_8.1.js|$(VSInstallDir)\JavaScript\References\underscorefilter.js|$(VSInstallDir)\JavaScript\References\showPlainComments.js;Implicit (Windows Phone 8.1)|$(VSInstallDir)\JavaScript\References\libhelp.js|$(VSInstallDir)\JavaScript\References\sitetypesWindows.js|$(VSInstallDir)\JavaScript\References\domWindowsPhone_8.1.js|$(VSInstallDir)\JavaScript\References\underscorefilter.js|$(VSInstallDir)\JavaScript\References\showPlainComments.js;Implicit (Web)|$(VSInstallDir)\JavaScript\References\libhelp.js|$(VSInstallDir)\JavaScript\References\sitetypesWeb.js|$(VSInstallDir)\JavaScript\References\domWeb.js|$(VSInstallDir)\JavaScript\References\underscorefilter.js|$(VSInstallDir)\JavaScript\References\showPlainComments.js;Dedicated Worker|$(VSInstallDir)\JavaScript\References\libhelp.js|$(VSInstallDir)\JavaScript\References\dedicatedworker.js|$(VSInstallDir)\JavaScript\References\underscorefilter.js|$(VSInstallDir)\JavaScript\References\showPlainComments.js;Generic|$(VSInstallDir)\JavaScript\References\libhelp.js|$(VSInstallDir)\JavaScript\References\underscorefilter.js|$(VSInstallDir)\JavaScript\References\showPlainComments.js;falsetruetruefalsetruetruetruetruefalsetruetruetruetruefalsetruetrue2truetruetruetrue2truetruefalsefalsefalsetruetruefalsetruetruetrue58truefalse2truetruetruetrue4truetruetruetrue2truetruetruefalsefalsetruetruefalsetruetruetrue58truefalse4truetruetruetrue4truetruetruetrue1truetruefalsefalsefalsetruetruetruetruetruetrue58truefalse4truetruetruetrue4truetruetruetrue1truetruefalsefalsefalsetruetruetruetruetruetrue58truefalse4falsetruetruetrue4truetruetruetrue2truetruefalsefalsefalsetruetruefalsetruetruetrue58truefalse4truetruetruetrue4truetruetruetrue1truetruefalsefalsefalsetruetruetruetruetruetrue58truefalse4falsetruetruetrue4truetruetruetrue1truetruefalsefalsefalsetruetruetruetruetruetrue58truefalse4falsetruetruetrue4truetruetruetrue2truetruetruefalsefalsetruetruefalsefalsetruetrue58truefalse4truetruetruetruefalsefalsefalsetruetruetruefalsetruetruetruetruetruetrue2.3falsetruefalsefalsetruetruefalsetruefalsetruefalsetruefalsefalse{}[]().,:;+-*/%&|^!~=<>? falsefalsetrue4truetruetruetrue2truetruetruefalsefalsetruetruefalsetruefalsetrue58truefalse4falsetruetruetrue2truetruetruetrue2truetruefalsefalsefalsetruetruefalsetruetruetrue58truefalse2falsetruetruetrueTrueTruetrueTrue1101011110101101100010001010001001101011000000167577360473600210110111000050001500015001000100010002000200050001000010000250100050012510001100111111111100001110010011000000001012048509000100111000001010011010101113276881921101101https://referencesource.microsoft.com/symbolshttps://msdl.microsoft.com/download/symbolsFunction: $FUNCTION, Thread: $TID $TNAMEtruefalsetruetruetruetruefalsefalsefalsetruefalsefalsefalsefalsetruetruetruetruefalsefalsetruetruefalsetruefalsefalsetruefalse00True<ExtensionRepositoryConfigList Capacity="0" xmlns="clr-namespace:Microsoft.VisualStudio.ExtensionManager;assembly=Microsoft.VisualStudio.ExtensionManager.Implementation" />Truefalsetruefalse2{B1BA9461-FC54-45B3-A484-CB6DD0B95C94}0215.0.0.0F7Shift+F7Ctrl+F4Ctrl+W, Ctrl+NCtrl+W, NF4F6falsefalsefalsefalsetruefalsefalsefalsetruefalsefalsefalsefalsetruetruetruetruefalsefalsetruetruefalsetruefalse{B1BA9461-FC54-45B3-A484-CB6DD0B95C94}0false01truefalsefalsetruefalsetruetrueTrueFalseTrueTrueTrueFalseFalseFalseTrueFalsefalse10{e7f851c8-6267-4794-b0fe-7bcab6dacbb4}-#1071Standard0true419100MatchCase=0 WholeWord=0 Hidden=1 Up=0 Selection=0 Block=0 KeepCase=0 SubFolders=0 KeepOpen=0 NameOnly=0 Append=0 Plain Document FindMatchCase=0 WholeWord=0 Hidden=1 Up=0 Selection=0 Block=0 KeepCase=0 SubFolders=1 KeepOpen=0 NameOnly=0 Append=0 Plain Files FindAllMatchCase=0 WholeWord=0 Hidden=1 Up=0 Selection=0 Block=0 KeepCase=0 SubFolders=0 KeepOpen=0 NameOnly=0 Append=0 Plain Document Find111111111111111Regex25607Design|Debug|NoToolWinOnTrueSemi-expandedTrueTrueOnFalsehttp://schemastore.org/api/json/catalog.json.\node_modules\.bin;$(VSINSTALLDIR)\Web\External;$(PATH);C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\binFalseFalseFalseFalsefalsefalseNoneFalseTrueTrueTrueTrueTrueTrueTrueTrue%VsInstallDir%\xml\SchemasTrue5105TrueFalseFalseTrueTrue4TrueFalseTrueTrueSplitViewDefaultPixelsFalseControlMouseWheelOpenInBrowserTrueTrueTrue8, 8SnapLinesTrueTrueTrueTrueTrueTrue\node_modules\,\bower_components\,\typings\,\lib\,.min.TrueFalsefalsetruefalsefalse-1506464101csv3.01002.03.01100TrueTrueTrue25FalseTrueTrueTrueDoubleQuote120False \ No newline at end of file From 7dace041c2eae29617d78af3ff74a7e88d8964aa Mon Sep 17 00:00:00 2001 From: Savorboard Date: Wed, 12 Sep 2018 12:35:54 +0800 Subject: [PATCH 13/21] update readme --- README.md | 4 ++-- README.zh-cn.md | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e991c05..e03b9ab 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # CAP                       [中文](https://github.com/dotnetcore/CAP/blob/develop/README.zh-cn.md) [![Travis branch](https://img.shields.io/travis/dotnetcore/CAP/develop.svg?label=travis-ci)](https://travis-ci.org/dotnetcore/CAP) -[![AppVeyor](https://ci.appveyor.com/api/projects/status/4mpe0tbu7n126vyw?svg=true)](https://ci.appveyor.com/project/yuleyule66/cap) +[![AppVeyor](https://ci.appveyor.com/api/projects/status/v8gfh6pe2u2laqoa?svg=true)](https://ci.appveyor.com/project/yuleyule66/cap) [![NuGet](https://img.shields.io/nuget/v/DotNetCore.CAP.svg)](https://www.nuget.org/packages/DotNetCore.CAP/) [![NuGet Preview](https://img.shields.io/nuget/vpre/DotNetCore.CAP.svg?label=nuget-pre)](https://www.nuget.org/packages/DotNetCore.CAP/) [![Member project of .NET Core Community](https://img.shields.io/badge/member%20project%20of-NCC-9e20c9.svg)](https://github.com/dotnetcore) @@ -157,7 +157,7 @@ namespace BusinessCode.Service { public interface ISubscriberService { - public void CheckReceivedMessage(DateTime person); + public void CheckReceivedMessage(DateTime datetime); } public class SubscriberService: ISubscriberService, ICapSubscribe diff --git a/README.zh-cn.md b/README.zh-cn.md index 2b8624f..67f213d 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -1,6 +1,6 @@ # CAP                       [English](https://github.com/dotnetcore/CAP/blob/develop/README.md) [![Travis branch](https://img.shields.io/travis/dotnetcore/CAP/develop.svg?label=travis-ci)](https://travis-ci.org/dotnetcore/CAP) -[![AppVeyor](https://ci.appveyor.com/api/projects/status/4mpe0tbu7n126vyw?svg=true)](https://ci.appveyor.com/project/yuleyule66/cap) +[![AppVeyor](https://ci.appveyor.com/api/projects/status/v8gfh6pe2u2laqoa?svg=true)](https://ci.appveyor.com/project/yuleyule66/cap) [![NuGet](https://img.shields.io/nuget/v/DotNetCore.CAP.svg)](https://www.nuget.org/packages/DotNetCore.CAP/) [![NuGet Preview](https://img.shields.io/nuget/vpre/DotNetCore.CAP.svg?label=nuget-pre)](https://www.nuget.org/packages/DotNetCore.CAP/) [![Member project of .NET Core Community](https://img.shields.io/badge/member%20project%20of-NCC-9e20c9.svg)](https://github.com/dotnetcore) @@ -166,7 +166,7 @@ namespace xxx.Service { public interface ISubscriberService { - public void CheckReceivedMessage(Person person); + public void CheckReceivedMessage(DateTime datetime); } public class SubscriberService: ISubscriberService, ICapSubscribe @@ -215,9 +215,9 @@ public void ShowTime2(DateTime datetime) } ``` -`ShowTime1` and `ShowTime2` are In different groups, they will be called at the same time. +`ShowTime1` 和 `ShowTime2` 处于不同的组,他们将会被同时调用。 -BTW, You can specify the default group name in the configuration : +PS,你可以通过下面的方式来指定默认的消费者组名称: ```C# services.AddCap(x => @@ -227,7 +227,6 @@ services.AddCap(x => ``` - ### Dashboard CAP 2.1+ 以上版本中提供了仪表盘(Dashboard)功能,你可以很方便的查看发出和接收到的消息。除此之外,你还可以在仪表盘中实时查看发送或者接收到的消息。 From 7e10da2924cf78b3a76f8991b23c78070832f42f Mon Sep 17 00:00:00 2001 From: Savorboard Date: Thu, 13 Sep 2018 10:33:36 +0800 Subject: [PATCH 14/21] update readme --- README.zh-cn.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.zh-cn.md b/README.zh-cn.md index 67f213d..993d6e7 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -10,6 +10,8 @@ CAP 是一个基于 .NET Standard 的 C# 库,它是一种处理分布式事务 你可以在这里[CAP Wiki](https://github.com/dotnetcore/CAP/wiki)看到更多详细资料。 +你可以在这里看到[CAP 视频教程](https://www.cnblogs.com/savorboard/p/cap-video-1.html),学习如何在项目中集成CAP。 + ## 预览(OverView) 在我们构建 SOA 或者 微服务系统的过程中,我们通常需要使用事件来对各个服务进行集成,在这过程中简单的使用消息队列并不能保证数据的最终一致性, From 7da53485d9de6cb659bcb31474a46f2264809f07 Mon Sep 17 00:00:00 2001 From: Savorboard Date: Fri, 14 Sep 2018 09:42:36 +0800 Subject: [PATCH 15/21] Fixed dashboard messages requeue error. ( #205 ) --- src/DotNetCore.CAP/Dashboard/BatchCommandDispatcher.cs | 6 +++--- src/DotNetCore.CAP/Dashboard/RouteCollectionExtensions.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/DotNetCore.CAP/Dashboard/BatchCommandDispatcher.cs b/src/DotNetCore.CAP/Dashboard/BatchCommandDispatcher.cs index d9df0bd..f711dee 100644 --- a/src/DotNetCore.CAP/Dashboard/BatchCommandDispatcher.cs +++ b/src/DotNetCore.CAP/Dashboard/BatchCommandDispatcher.cs @@ -9,9 +9,9 @@ namespace DotNetCore.CAP.Dashboard { internal class BatchCommandDispatcher : IDashboardDispatcher { - private readonly Action _command; + private readonly Action _command; - public BatchCommandDispatcher(Action command) + public BatchCommandDispatcher(Action command) { _command = command; } @@ -27,7 +27,7 @@ namespace DotNetCore.CAP.Dashboard foreach (var messageId in messageIds) { - var id = int.Parse(messageId); + var id = long.Parse(messageId); _command(context, id); } diff --git a/src/DotNetCore.CAP/Dashboard/RouteCollectionExtensions.cs b/src/DotNetCore.CAP/Dashboard/RouteCollectionExtensions.cs index dec40eb..4b14783 100644 --- a/src/DotNetCore.CAP/Dashboard/RouteCollectionExtensions.cs +++ b/src/DotNetCore.CAP/Dashboard/RouteCollectionExtensions.cs @@ -103,7 +103,7 @@ namespace DotNetCore.CAP.Dashboard public static void AddPublishBatchCommand( this RouteCollection routes, string pathTemplate, - Action command) + Action command) { if (routes == null) { From 77a0ba3009c197d919bf38d6afd199a7b0d8ed66 Mon Sep 17 00:00:00 2001 From: Savorboard Date: Fri, 5 Oct 2018 21:55:27 +0800 Subject: [PATCH 16/21] Refactoring --- src/DotNetCore.CAP/ISubscribeExecutor.Default.cs | 2 +- src/DotNetCore.CAP/Infrastructure/Helper.cs | 1 - src/DotNetCore.CAP/Infrastructure/SnowflakeId.cs | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/DotNetCore.CAP/ISubscribeExecutor.Default.cs b/src/DotNetCore.CAP/ISubscribeExecutor.Default.cs index 6bd1a68..84a1dca 100644 --- a/src/DotNetCore.CAP/ISubscribeExecutor.Default.cs +++ b/src/DotNetCore.CAP/ISubscribeExecutor.Default.cs @@ -164,7 +164,7 @@ namespace DotNetCore.CAP if (!_selector.TryGetTopicExector(receivedMessage.Name, receivedMessage.Group, out var executor)) { - var error = $"message can not be found subscriber, Message:{receivedMessage},\r\n see: https://github.com/dotnetcore/CAP/issues/63"; + var error = $"Message can not be found subscriber. {receivedMessage} \r\n see: https://github.com/dotnetcore/CAP/issues/63"; throw new SubscriberNotFoundException(error); } diff --git a/src/DotNetCore.CAP/Infrastructure/Helper.cs b/src/DotNetCore.CAP/Infrastructure/Helper.cs index 3f023b9..1fe4e39 100644 --- a/src/DotNetCore.CAP/Infrastructure/Helper.cs +++ b/src/DotNetCore.CAP/Infrastructure/Helper.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.ComponentModel; -using System.Linq; using System.Reflection; using DotNetCore.CAP.Diagnostics; using Newtonsoft.Json; diff --git a/src/DotNetCore.CAP/Infrastructure/SnowflakeId.cs b/src/DotNetCore.CAP/Infrastructure/SnowflakeId.cs index d0e4a5f..1fcc3d0 100644 --- a/src/DotNetCore.CAP/Infrastructure/SnowflakeId.cs +++ b/src/DotNetCore.CAP/Infrastructure/SnowflakeId.cs @@ -2,6 +2,7 @@ // An object that generates IDs. This is broken into a separate class in case we ever want to support multiple worker threads per process using System; +using System.Threading; namespace DotNetCore.CAP.Infrastructure { @@ -49,7 +50,7 @@ namespace DotNetCore.CAP.Infrastructure { lock (s_lock) { - return _snowflakeId ?? (_snowflakeId = new SnowflakeId(AppDomain.CurrentDomain.Id, datacenterId)); + return _snowflakeId ?? (_snowflakeId = new SnowflakeId(Thread.CurrentThread.ManagedThreadId, datacenterId)); } } From f1f88d820bfbee33c73bd17d8d5f73bfd4345075 Mon Sep 17 00:00:00 2001 From: Savorboard Date: Sun, 7 Oct 2018 10:40:17 +0800 Subject: [PATCH 17/21] Fixed SnowflakeId workerId to random id. --- .../Infrastructure/SnowflakeId.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/DotNetCore.CAP/Infrastructure/SnowflakeId.cs b/src/DotNetCore.CAP/Infrastructure/SnowflakeId.cs index 1fcc3d0..5a1dd3a 100644 --- a/src/DotNetCore.CAP/Infrastructure/SnowflakeId.cs +++ b/src/DotNetCore.CAP/Infrastructure/SnowflakeId.cs @@ -2,7 +2,6 @@ // An object that generates IDs. This is broken into a separate class in case we ever want to support multiple worker threads per process using System; -using System.Threading; namespace DotNetCore.CAP.Infrastructure { @@ -24,10 +23,10 @@ namespace DotNetCore.CAP.Infrastructure private static SnowflakeId _snowflakeId; private readonly object _lock = new object(); - private static readonly object s_lock = new object(); + private static readonly object SLock = new object(); private long _lastTimestamp = -1L; - private SnowflakeId(long workerId, long datacenterId, long sequence = 0L) + public SnowflakeId(long workerId, long datacenterId, long sequence = 0L) { WorkerId = workerId; DatacenterId = datacenterId; @@ -46,11 +45,19 @@ namespace DotNetCore.CAP.Infrastructure public long Sequence { get; internal set; } - public static SnowflakeId Default(long datacenterId = 0) + public static SnowflakeId Default() { - lock (s_lock) + lock (SLock) { - return _snowflakeId ?? (_snowflakeId = new SnowflakeId(Thread.CurrentThread.ManagedThreadId, datacenterId)); + if (_snowflakeId != null) + { + return _snowflakeId; + } + + var random = new Random(); + var workerId = random.Next((int)MaxWorkerId); + var datacenterId = random.Next((int)MaxDatacenterId); + return _snowflakeId = new SnowflakeId(workerId, datacenterId); } } From b6311f4a7607c95f3f44d4c2f27db0736f3f05be Mon Sep 17 00:00:00 2001 From: Savorboard Date: Mon, 8 Oct 2018 22:15:08 +0800 Subject: [PATCH 18/21] Update README.md --- README.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e03b9ab..03e98cb 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ public class PublishController : Controller { using (var transaction = connection.BeginTransaction(_capBus, autoCommit: true)) { - //your business code + //your business logic code _capBus.Publish("xxx.services.show.time", DateTime.Now); } @@ -118,7 +118,7 @@ public class PublishController : Controller { using (var trans = dbContext.Database.BeginTransaction(_capBus, autoCommit: true)) { - //your business code + //your business logic code _capBus.Publish("xxx.services.show.time", DateTime.Now); } @@ -131,7 +131,7 @@ public class PublishController : Controller ### Subscribe -**In Action Method** +**In Controller Action** Add the Attribute `[CapSubscribe()]` on Action to subscribe message: @@ -147,7 +147,7 @@ public class PublishController : Controller ``` -**In Service Method** +**In Business Logic Service** If your subscribe method is not in the Controller,then your subscribe class need to Inheritance `ICapSubscribe`: @@ -179,7 +179,10 @@ public void ConfigureServices(IServiceCollection services) //Note: The injection of services needs before of `services.AddCap()` services.AddTransient(); - services.AddCap(x=>{}); + services.AddCap(x=> + { + //... + }); } ``` From a2aa446412f96ec0790560bb6b9f419e14dec4f9 Mon Sep 17 00:00:00 2001 From: Savorboard Date: Sat, 20 Oct 2018 16:08:32 +0800 Subject: [PATCH 19/21] upgrade dependent nuget packages. --- src/DotNetCore.CAP.Kafka/DotNetCore.CAP.Kafka.csproj | 2 +- src/DotNetCore.CAP.MySql/DotNetCore.CAP.MySql.csproj | 2 +- .../DotNetCore.CAP.PostgreSql.csproj | 2 +- .../DotNetCore.CAP.MongoDB.Test.csproj | 9 ++++++--- .../DotNetCore.CAP.MySql.Test.csproj | 11 +++++++---- .../DotNetCore.CAP.PostgreSql.Test.csproj | 11 +++++++---- .../DotNetCore.CAP.SqlServer.Test.csproj | 11 +++++++---- test/DotNetCore.CAP.Test/DotNetCore.CAP.Test.csproj | 11 +++++++---- 8 files changed, 37 insertions(+), 22 deletions(-) diff --git a/src/DotNetCore.CAP.Kafka/DotNetCore.CAP.Kafka.csproj b/src/DotNetCore.CAP.Kafka/DotNetCore.CAP.Kafka.csproj index 13388ea..a84feee 100644 --- a/src/DotNetCore.CAP.Kafka/DotNetCore.CAP.Kafka.csproj +++ b/src/DotNetCore.CAP.Kafka/DotNetCore.CAP.Kafka.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/DotNetCore.CAP.MySql/DotNetCore.CAP.MySql.csproj b/src/DotNetCore.CAP.MySql/DotNetCore.CAP.MySql.csproj index 002ebeb..ac716ba 100644 --- a/src/DotNetCore.CAP.MySql/DotNetCore.CAP.MySql.csproj +++ b/src/DotNetCore.CAP.MySql/DotNetCore.CAP.MySql.csproj @@ -15,7 +15,7 @@ - + diff --git a/src/DotNetCore.CAP.PostgreSql/DotNetCore.CAP.PostgreSql.csproj b/src/DotNetCore.CAP.PostgreSql/DotNetCore.CAP.PostgreSql.csproj index fc76e6c..fc854c0 100644 --- a/src/DotNetCore.CAP.PostgreSql/DotNetCore.CAP.PostgreSql.csproj +++ b/src/DotNetCore.CAP.PostgreSql/DotNetCore.CAP.PostgreSql.csproj @@ -15,7 +15,7 @@ - + diff --git a/test/DotNetCore.CAP.MongoDB.Test/DotNetCore.CAP.MongoDB.Test.csproj b/test/DotNetCore.CAP.MongoDB.Test/DotNetCore.CAP.MongoDB.Test.csproj index b04ca28..f758ee0 100644 --- a/test/DotNetCore.CAP.MongoDB.Test/DotNetCore.CAP.MongoDB.Test.csproj +++ b/test/DotNetCore.CAP.MongoDB.Test/DotNetCore.CAP.MongoDB.Test.csproj @@ -10,9 +10,12 @@ - - - + + + + all + runtime; build; native; contentfiles; analyzers + diff --git a/test/DotNetCore.CAP.MySql.Test/DotNetCore.CAP.MySql.Test.csproj b/test/DotNetCore.CAP.MySql.Test/DotNetCore.CAP.MySql.Test.csproj index 1b98a58..6f6d37b 100644 --- a/test/DotNetCore.CAP.MySql.Test/DotNetCore.CAP.MySql.Test.csproj +++ b/test/DotNetCore.CAP.MySql.Test/DotNetCore.CAP.MySql.Test.csproj @@ -12,12 +12,15 @@ - - - + + + all + runtime; build; native; contentfiles; analyzers + + - + diff --git a/test/DotNetCore.CAP.PostgreSql.Test/DotNetCore.CAP.PostgreSql.Test.csproj b/test/DotNetCore.CAP.PostgreSql.Test/DotNetCore.CAP.PostgreSql.Test.csproj index 3177749..f1bf2bd 100644 --- a/test/DotNetCore.CAP.PostgreSql.Test/DotNetCore.CAP.PostgreSql.Test.csproj +++ b/test/DotNetCore.CAP.PostgreSql.Test/DotNetCore.CAP.PostgreSql.Test.csproj @@ -7,10 +7,13 @@ - - - - + + + + + all + runtime; build; native; contentfiles; analyzers + diff --git a/test/DotNetCore.CAP.SqlServer.Test/DotNetCore.CAP.SqlServer.Test.csproj b/test/DotNetCore.CAP.SqlServer.Test/DotNetCore.CAP.SqlServer.Test.csproj index 7df0282..5bdcd2f 100644 --- a/test/DotNetCore.CAP.SqlServer.Test/DotNetCore.CAP.SqlServer.Test.csproj +++ b/test/DotNetCore.CAP.SqlServer.Test/DotNetCore.CAP.SqlServer.Test.csproj @@ -12,13 +12,16 @@ - + - - + + all + runtime; build; native; contentfiles; analyzers + + - + diff --git a/test/DotNetCore.CAP.Test/DotNetCore.CAP.Test.csproj b/test/DotNetCore.CAP.Test/DotNetCore.CAP.Test.csproj index bdab81c..1b046d9 100644 --- a/test/DotNetCore.CAP.Test/DotNetCore.CAP.Test.csproj +++ b/test/DotNetCore.CAP.Test/DotNetCore.CAP.Test.csproj @@ -6,13 +6,16 @@ - + - - + + all + runtime; build; native; contentfiles; analyzers + + - + From 86868f5faa9cb2f733863e95bac7c63e17315400 Mon Sep 17 00:00:00 2001 From: Savorboard Date: Fri, 26 Oct 2018 14:44:22 +0800 Subject: [PATCH 20/21] Add SourceLink Support --- CAP.sln | 1 + Directory.Build.props | 39 +++++++++++++++++++++++++-------------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/CAP.sln b/CAP.sln index e87e109..13eac1f 100644 --- a/CAP.sln +++ b/CAP.sln @@ -31,6 +31,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{10C0818D build.cake = build.cake build.ps1 = build.ps1 build.sh = build.sh + Directory.Build.props = Directory.Build.props build\index.cake = build\index.cake build\util.cake = build\util.cake build\version.cake = build\version.cake diff --git a/Directory.Build.props b/Directory.Build.props index c4ae862..a431f52 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,18 +1,29 @@ - - - - CAP - .NET Core Community;Savorboard - https://github.com/dotnetcore/CAP - git - $(MSBuildThisFileDirectory) - https://avatars2.githubusercontent.com/u/19404084 - https://github.com/dotnetcore/CAP - https://github.com/dotnetcore/CAP/blob/master/LICENSE.txt - CAP;EventBus;Distributed Transaction - EventBus and eventually consistency in distributed architectures. - + + + + CAP + .NET Core Community;Savorboard + https://github.com/dotnetcore/CAP + git + $(MSBuildThisFileDirectory) + https://avatars2.githubusercontent.com/u/19404084 + https://github.com/dotnetcore/CAP + https://github.com/dotnetcore/CAP/blob/master/LICENSE.txt + CAP;EventBus;Distributed Transaction + EventBus outbox integration and eventually consistency in microservice architectures. + + + + + true + true + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb + + + + + \ No newline at end of file From b7abc4a1aa0694201d3381900e36b9892473a232 Mon Sep 17 00:00:00 2001 From: Savorboard Date: Mon, 29 Oct 2018 23:07:28 +0800 Subject: [PATCH 21/21] update nuget api key --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 8a571f4..88810e7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -21,6 +21,6 @@ deploy: on: appveyor_repo_tag: true api_key: - secure: 62g+D0FPQQgVHQE+VaLPri7EAoQgu8WQbtXaawwa0c8o6fLxTc2oJSx2MgcLvpzN + secure: Qjj0e1B9giVIpozI/J3DMcF5nT1hchlE3xpGctBoqMrT8r/0Z1suwEdMAfTBMkjn skip_symbols: true artifact: /artifacts\/packages\/.+\.nupkg/