@@ -25,7 +25,7 @@ services.AddCap(capOptions => | |||||
}); | }); | ||||
``` | ``` | ||||
For specific transport and storage configuration, you can take a look at the configuration options provided by the specific components in the [Transports](../transports/general.md) section and the [Persistent](../persistent/general.md) section. | |||||
For specific transport and storage configuration, you can take a look at the configuration options provided by the specific components in the [Transports](../transport/general.md) section and the [Persistent](../storage/general.md) section. | |||||
## Custom configuration | ## Custom configuration | ||||
@@ -8,11 +8,11 @@ After CAP receives a message, it sends the message to Transport(RabitMq, Kafka.. | |||||
When you send message using the `ICapPublisher` interface, CAP will dispatch message to the corresponding Transport. Currently, bulk messaging is not supported. | When you send message using the `ICapPublisher` interface, CAP will dispatch message to the corresponding Transport. Currently, bulk messaging is not supported. | ||||
For more information on transports, see [Transports](../transports/general.md) section. | |||||
For more information on transports, see [Transports](../transport/general.md) section. | |||||
## Storage | ## Storage | ||||
CAP will store the message after receiving it. For more information on storage, see the [Storage](../persistent/general.md) section. | |||||
CAP will store the message after receiving it. For more information on storage, see the [Storage](../storage/general.md) section. | |||||
## Retry | ## Retry | ||||
@@ -32,9 +32,9 @@ services.AddCap | |||||
## Message Adapter (removed in v3.0) | ## Message Adapter (removed in v3.0) | ||||
In heterogeneous systems, sometimes you need to communicate with other systems, but other systems use message objects that may be different from CAP's [**Wrapper Object**](../persistent/general.md#_7). This time maybe you need to customize the message wapper. | |||||
In heterogeneous systems, sometimes you need to communicate with other systems, but other systems use message objects that may be different from CAP's [**Wrapper Object**](../storage/general.md#_7). This time maybe you need to customize the message wapper. | |||||
CAP provides the `IMessagePacker` interface for customizing the [**Wrapper Object**](../persistent/general.md#_7). Custom MessagePacker usually packs and unpacks the `CapMessage` In this process you can add your own business objects. | |||||
CAP provides the `IMessagePacker` interface for customizing the [**Wrapper Object**](../storage/general.md#_7). Custom MessagePacker usually packs and unpacks the `CapMessage` In this process you can add your own business objects. | |||||
Usage : | Usage : | ||||
@@ -1,4 +1,44 @@ | |||||
# Consul | # Consul | ||||
Consul is a distributed service mesh to connect, secure, and configure services across any runtime platform and public or private cloud. | |||||
[Consul](https://www.consul.io/) is a distributed service mesh to connect, secure, and configure services across any runtime platform and public or private cloud. | |||||
## Consul Configuration for dashboard | |||||
CAP's Dashboard uses Consul as a service discovery to get the data of other nodes, and you can switch to the Servers page to see other nodes. | |||||
![](https://camo.githubusercontent.com/54c00c6ae65ce1d7b9109ed8cbcdca703a050c47/687474703a2f2f696d61676573323031372e636e626c6f67732e636f6d2f626c6f672f3235303431372f3230313731302f3235303431372d32303137313030343232313030313838302d313136323931383336322e706e67) | |||||
Click the `Switch` button to switch to the target node, CAP will use a proxy to get the data of the node you switched to. | |||||
The following is a configuration example, you need to configure them on each node. | |||||
```C# | |||||
services.AddCap(x => | |||||
{ | |||||
x.UseMySql(Configuration.GetValue<string>("ConnectionString")); | |||||
x.UseRabbitMQ("localhost"); | |||||
x.UseDashboard(); | |||||
x.UseDiscovery(_ => | |||||
{ | |||||
_.DiscoveryServerHostName = "localhost"; | |||||
_.DiscoveryServerPort = 8500; | |||||
_.CurrentNodeHostName = Configuration.GetValue<string>("ASPNETCORE_HOSTNAME"); | |||||
_.CurrentNodePort = Configuration.GetValue<int>("ASPNETCORE_PORT"); | |||||
_.NodeId = Configuration.GetValue<string>("NodeId"); | |||||
_.NodeName = Configuration.GetValue<string>("NodeName"); | |||||
}); | |||||
}); | |||||
``` | |||||
Consul 1.6.2: | |||||
``` | |||||
consul agent -dev | |||||
``` | |||||
Windows 10, ASP.NET Core 3.1: | |||||
```sh | |||||
set ASPNETCORE_HOSTNAME=localhost&& set ASPNETCORE_PORT=5001&& dotnet run --urls=http://localhost:5001 NodeId=1 NodeName=CAP-1 ConnectionString="Server=localhost;Database=aaa;UserId=xxx;Password=xxx;" | |||||
set ASPNETCORE_HOSTNAME=localhost&& set ASPNETCORE_PORT=5002&& dotnet run --urls=http://localhost:5002 NodeId=2 NodeName=CAP-2 ConnectionString="Server=localhost;Database=bbb;UserId=xxx;Password=xxx;" | |||||
``` |
@@ -1,3 +0,0 @@ | |||||
# Metrics | |||||
TODO: |
@@ -52,11 +52,11 @@ CAP 接收到消息之后会将消息发送到 Transport, 由 Transport 进行 | |||||
当你使用 `ICapPublisher` 接口发送时,CAP将会将消息调度到相应的 Transport中去,目前还不支持批量发送消息。 | 当你使用 `ICapPublisher` 接口发送时,CAP将会将消息调度到相应的 Transport中去,目前还不支持批量发送消息。 | ||||
有关 Transports 的更多信息,可以查看 [Transports](../transports/general.md) 章节。 | |||||
有关 Transports 的更多信息,可以查看 [Transports](../transport/general.md) 章节。 | |||||
## 消息存储 | ## 消息存储 | ||||
CAP 接收到消息之后会将消息进行 Persistent(持久化), 有关 Persistent 的更多信息,可以查看 [Persistent](../persistent/general.md) 章节。 | |||||
CAP 接收到消息之后会将消息进行 Persistent(持久化), 有关 Persistent 的更多信息,可以查看 [Persistent](../storage/general.md) 章节。 | |||||
## 消息重试 | ## 消息重试 | ||||
@@ -34,9 +34,9 @@ services.AddCap | |||||
## 消息适配器 (v3.0移除 ) | ## 消息适配器 (v3.0移除 ) | ||||
在异构系统中,有时候需要和其他系统进行通讯,但是其他系统使用的消息对象可能和 CAP 的[**包装器对象**](../persistent/general.md#_7)不一样,这个时候就需要对消息进行自定义适配。 | |||||
在异构系统中,有时候需要和其他系统进行通讯,但是其他系统使用的消息对象可能和 CAP 的[**包装器对象**](../storage/general.md#_7)不一样,这个时候就需要对消息进行自定义适配。 | |||||
CAP 提供了 `IMessagePacker` 接口用于对 [**包装器对象**](../persistent/general.md#_7) 进行自定义,自定义的 MessagePacker 通常是将 `CapMessage` 进行打包和解包操作,在这个过程中可以添加自己的业务对象。 | |||||
CAP 提供了 `IMessagePacker` 接口用于对 [**包装器对象**](../storage/general.md#_7) 进行自定义,自定义的 MessagePacker 通常是将 `CapMessage` 进行打包和解包操作,在这个过程中可以添加自己的业务对象。 | |||||
使用方法: | 使用方法: | ||||
@@ -1,4 +1,44 @@ | |||||
# Consul | # Consul | ||||
Consul is a distributed service mesh to connect, secure, and configure services across any runtime platform and public or private cloud. | |||||
[Consul](https://www.consul.io/) 是一个分布式服务网格,用于跨任何运行时平台和公共或私有云连接,保护和配置服务。 | |||||
## Dashboard 中的 Consul 配置 | |||||
CAP的 Dashboard 使用 Consul 作为服务发现来显示其他节点的数据,然后你就在任意节点的 Dashboard 中切换到 Servers 页面看到其他的节点。 | |||||
![](https://camo.githubusercontent.com/54c00c6ae65ce1d7b9109ed8cbcdca703a050c47/687474703a2f2f696d61676573323031372e636e626c6f67732e636f6d2f626c6f672f3235303431372f3230313731302f3235303431372d32303137313030343232313030313838302d313136323931383336322e706e67) | |||||
通过点击 Switch 按钮来切换到其他的节点看到其他节点的数据,而不必访问很多地址来分别查看。 | |||||
以下是一个配置示例, 你需要在每个节点分别配置: | |||||
```C# | |||||
services.AddCap(x => | |||||
{ | |||||
x.UseMySql(Configuration.GetValue<string>("ConnectionString")); | |||||
x.UseRabbitMQ("localhost"); | |||||
x.UseDashboard(); | |||||
x.UseDiscovery(_ => | |||||
{ | |||||
_.DiscoveryServerHostName = "localhost"; | |||||
_.DiscoveryServerPort = 8500; | |||||
_.CurrentNodeHostName = Configuration.GetValue<string>("ASPNETCORE_HOSTNAME"); | |||||
_.CurrentNodePort = Configuration.GetValue<int>("ASPNETCORE_PORT"); | |||||
_.NodeId = Configuration.GetValue<string>("NodeId"); | |||||
_.NodeName = Configuration.GetValue<string>("NodeName"); | |||||
}); | |||||
}); | |||||
``` | |||||
Consul 1.6.2: | |||||
``` | |||||
consul agent -dev | |||||
``` | |||||
Windows 10, ASP.NET Core 3.1: | |||||
```sh | |||||
set ASPNETCORE_HOSTNAME=localhost&& set ASPNETCORE_PORT=5001&& dotnet run --urls=http://localhost:5001 NodeId=1 NodeName=CAP-1 ConnectionString="Server=localhost;Database=aaa;UserId=xxx;Password=xxx;" | |||||
set ASPNETCORE_HOSTNAME=localhost&& set ASPNETCORE_PORT=5002&& dotnet run --urls=http://localhost:5002 NodeId=2 NodeName=CAP-2 ConnectionString="Server=localhost;Database=bbb;UserId=xxx;Password=xxx;" | |||||
``` |
@@ -1,3 +0,0 @@ | |||||
# Metrics | |||||
TODO: |
@@ -85,21 +85,22 @@ nav: | |||||
- Serialization: user-guide/en/cap/serialization.md | - Serialization: user-guide/en/cap/serialization.md | ||||
- Transactions: user-guide/en/cap/transactions.md | - Transactions: user-guide/en/cap/transactions.md | ||||
- Idempotence: user-guide/en/cap/idempotence.md | - Idempotence: user-guide/en/cap/idempotence.md | ||||
- Transports: | |||||
- General: user-guide/en/transports/general.md | |||||
- RabbitMQ: user-guide/en/transports/rabbitmq.md | |||||
- Apache Kafka®: user-guide/en/transports/kafka.md | |||||
- Azure Service Bus: user-guide/en/transports/azure-service-bus.md | |||||
- Amazon SQS: user-guide/en/transports/aws-sqs.md | |||||
- In-Memory Queue: user-guide/en/transports/in-memory-queue.md | |||||
- Transport: | |||||
- General: user-guide/en/transport/general.md | |||||
- RabbitMQ: user-guide/en/transport/rabbitmq.md | |||||
- Apache Kafka®: user-guide/en/transport/kafka.md | |||||
- Azure Service Bus: user-guide/en/transport/azure-service-bus.md | |||||
- Amazon SQS: user-guide/en/transport/aws-sqs.md | |||||
- In-Memory Queue: user-guide/en/transport/in-memory-queue.md | |||||
- Storage: | - Storage: | ||||
- General: user-guide/en/persistent/general.md | |||||
- SQL Server: user-guide/en/persistent/sqlserver.md | |||||
- MySQL: user-guide/en/persistent/mysql.md | |||||
- PostgreSql: user-guide/en/persistent/postgresql.md | |||||
- MongoDB: user-guide/en/persistent/mongodb.md | |||||
- In-Memory: user-guide/en/persistent/in-memory-storage.md | |||||
- General: user-guide/en/storage/general.md | |||||
- SQL Server: user-guide/en/storage/sqlserver.md | |||||
- MySQL: user-guide/en/storage/mysql.md | |||||
- PostgreSql: user-guide/en/storage/postgresql.md | |||||
- MongoDB: user-guide/en/storage/mongodb.md | |||||
- In-Memory: user-guide/en/storage/in-memory-storage.md | |||||
- Monitoring: | - Monitoring: | ||||
- Consul: user-guide/en/monitoring/consul.md | |||||
- Dashboard: user-guide/en/monitoring/dashboard.md | - Dashboard: user-guide/en/monitoring/dashboard.md | ||||
- Diagnostics: user-guide/en/monitoring/diagnostics.md | - Diagnostics: user-guide/en/monitoring/diagnostics.md | ||||
- Samples: | - Samples: | ||||
@@ -119,25 +120,24 @@ nav: | |||||
- 运输: user-guide/zh/cap/transactions.md | - 运输: user-guide/zh/cap/transactions.md | ||||
- 幂等性: user-guide/zh/cap/idempotence.md | - 幂等性: user-guide/zh/cap/idempotence.md | ||||
- 传输: | - 传输: | ||||
- 简介: user-guide/zh/transports/general.md | |||||
- RabbitMQ: user-guide/zh/transports/rabbitmq.md | |||||
- Apache Kafka®: user-guide/zh/transports/kafka.md | |||||
- Azure Service Bus: user-guide/zh/transports/azure-service-bus.md | |||||
- Amazon SQS: user-guide/zh/transports/aws-sqs.md | |||||
- In-Memory Queue: user-guide/zh/transports/in-memory-queue.md | |||||
- 持久化: | |||||
- 简介: user-guide/zh/persistent/general.md | |||||
- SQL Server: user-guide/zh/persistent/sqlserver.md | |||||
- MySQL: user-guide/zh/persistent/mysql.md | |||||
- PostgreSql: user-guide/zh/persistent/postgresql.md | |||||
- MongoDB: user-guide/zh/persistent/mongodb.md | |||||
- In-Memory: user-guide/zh/persistent/in-memory-storage.md | |||||
- 简介: user-guide/zh/transport/general.md | |||||
- RabbitMQ: user-guide/zh/transport/rabbitmq.md | |||||
- Apache Kafka®: user-guide/zh/transport/kafka.md | |||||
- Azure Service Bus: user-guide/zh/transport/azure-service-bus.md | |||||
- Amazon SQS: user-guide/zh/transport/aws-sqs.md | |||||
- In-Memory Queue: user-guide/zh/transport/in-memory-queue.md | |||||
- 存储: | |||||
- 简介: user-guide/zh/storage/general.md | |||||
- SQL Server: user-guide/zh/storage/sqlserver.md | |||||
- MySQL: user-guide/zh/storage/mysql.md | |||||
- PostgreSql: user-guide/zh/storage/postgresql.md | |||||
- MongoDB: user-guide/zh/storage/mongodb.md | |||||
- In-Memory: user-guide/zh/storage/in-memory-storage.md | |||||
- 监控: | - 监控: | ||||
- Consul: user-guide/zh/monitoring/consul.md | - Consul: user-guide/zh/monitoring/consul.md | ||||
- Dashboard: user-guide/zh/monitoring/dashboard.md | - Dashboard: user-guide/zh/monitoring/dashboard.md | ||||
- Diagnostics: user-guide/zh/monitoring/diagnostics.md | |||||
- 性能追踪: user-guide/zh/monitoring/diagnostics.md | |||||
- 健康检查: user-guide/zh/monitoring/health-checks.md | - 健康检查: user-guide/zh/monitoring/health-checks.md | ||||
- Metrics: user-guide/zh/monitoring/metrics.md | |||||
- 示例: | - 示例: | ||||
- Github: user-guide/zh/samples/github.md | - Github: user-guide/zh/samples/github.md | ||||
- eShopOnContainers: user-guide/zh/samples/eshoponcontainers.md | - eShopOnContainers: user-guide/zh/samples/eshoponcontainers.md | ||||