@@ -2,7 +2,7 @@ Title: CAP - A distributed transaction solution in micro-service base on eventua | |||||
# CAP | # CAP | ||||
<img height="140" align="right" src="https://cap.dotnetcore.xyz/img/logo.svg"> | |||||
<img width="140" align="right" src="https://cap.dotnetcore.xyz/img/logo.svg"> | |||||
[![Travis branch](https://img.shields.io/travis/dotnetcore/CAP/master.svg?label=travis-ci)](https://travis-ci.org/dotnetcore/CAP) | [![Travis branch](https://img.shields.io/travis/dotnetcore/CAP/master.svg?label=travis-ci)](https://travis-ci.org/dotnetcore/CAP) | ||||
[![AppVeyor](https://ci.appveyor.com/api/projects/status/v8gfh6pe2u2laqoa/branch/master?svg=true)](https://ci.appveyor.com/project/yuleyule66/cap/branch/master) | [![AppVeyor](https://ci.appveyor.com/api/projects/status/v8gfh6pe2u2laqoa/branch/master?svg=true)](https://ci.appveyor.com/project/yuleyule66/cap/branch/master) | ||||
[![NuGet](https://img.shields.io/nuget/v/DotNetCore.CAP.svg)](https://www.nuget.org/packages/DotNetCore.CAP/) | [![NuGet](https://img.shields.io/nuget/v/DotNetCore.CAP.svg)](https://www.nuget.org/packages/DotNetCore.CAP/) | ||||
@@ -2,6 +2,9 @@ | |||||
SQL Server is a relational database management system developed by Microsoft. CAP has supported SQL Server as persistent. | SQL Server is a relational database management system developed by Microsoft. CAP has supported SQL Server as persistent. | ||||
!!! warning "Warning" | |||||
We currently use `Microsoft.Data.SqlClient` as the database driver, which is the future of SQL Server drivers, and we have abandoned `System.Data.SqlClient`, we suggest you switch into. | |||||
## Configuration | ## Configuration | ||||
To use SQL Server storage, you need to install the following extensions from NuGet: | To use SQL Server storage, you need to install the following extensions from NuGet: | ||||
@@ -14,9 +14,7 @@ To use Azure Service Bus as a message transport, you need to install the followi | |||||
```powershell | ```powershell | ||||
PM> Install-Package DotNetCore.CAP.AzureServiceBus | PM> Install-Package DotNetCore.CAP.AzureServiceBus | ||||
``` | ``` | ||||
Then you can add memory-based configuration items to the `ConfigureServices` method of `Startup.cs`. | |||||
Next, add configuration items to the `ConfigureServices` method of `Startup.cs`: | |||||
```csharp | ```csharp | ||||
@@ -10,7 +10,8 @@ To use In Memory Queue as a message transporter, you need to install the followi | |||||
PM> Install-Package Savorboard.CAP.InMemoryMessageQueue | PM> Install-Package Savorboard.CAP.InMemoryMessageQueue | ||||
``` | ``` | ||||
Then you can add memory-based configuration items to the `ConfigureServices` method of `Startup.cs`. | |||||
Next, add configuration items to the `ConfigureServices` method of `Startup.cs`: | |||||
```csharp | ```csharp | ||||
@@ -13,7 +13,7 @@ PM> Install-Package DotNetCore.CAP.Kafka | |||||
``` | ``` | ||||
Then you can add memory-based configuration items to the `ConfigureServices` method of `Startup.cs`. | |||||
Then you can add configuration items to the `ConfigureServices` method of `Startup.cs`. | |||||
```csharp | ```csharp | ||||
@@ -64,4 +64,12 @@ services.AddCap(x => | |||||
}); | }); | ||||
}); | }); | ||||
``` | |||||
#### How to connect cluster | |||||
using comma split connection string, like this: | |||||
``` | |||||
x=> x.UseRabbitMQ("localhost:5672,localhost:5673,localhost:5674") | |||||
``` | ``` |
@@ -2,6 +2,9 @@ | |||||
SQL Server 是由微软开发的一个关系型数据库,你可以使用 SQL Server 来作为 CAP 消息的持久化。 | SQL Server 是由微软开发的一个关系型数据库,你可以使用 SQL Server 来作为 CAP 消息的持久化。 | ||||
!!! warning "注意" | |||||
我们目前使用 `Microsoft.Data.SqlClient` 作为数据库驱动程序,它是SQL Server 驱动的未来,并且已经放弃了 `System.Data.SqlClient`,我们建议你切换过去。 | |||||
## 配置 | ## 配置 | ||||
要使用 SQL Server 存储,你需要从 NuGet 安装以下扩展包: | 要使用 SQL Server 存储,你需要从 NuGet 安装以下扩展包: | ||||
@@ -66,3 +66,11 @@ services.AddCap(x => | |||||
}); | }); | ||||
``` | ``` | ||||
#### 如何连接 RabbitMQ 集群? | |||||
使用逗号分隔连接字符串即可,如下: | |||||
``` | |||||
x=> x.UseRabbitMQ("localhost:5672,localhost:5673,localhost:5674") | |||||
``` |