Skip to content

Commit 494650f

Browse files
committed
Merge branch 'master' of https://github.com/dotnetcore/CAP
2 parents 63b091c + 66470a6 commit 494650f

35 files changed

+452
-206
lines changed

docs/content/user-guide/en/cap/configuration.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -152,4 +152,11 @@ By default, CAP will only read one message from the message queue, then execute
152152
If set to true, the consumer will prefetch some messages to the memory queue, and then distribute them to the .NET thread pool for execution.
153153

154154
!!! note "Precautions"
155-
Setting it to true may cause some problems. When the subscription method executes too slowly and takes too long, it will cause the retry thread to pick up messages that have not yet been executed. The retry thread picks up messages from 4 minutes (FallbackWindowLookbackSeconds) ago by default , that is to say, if the message backlog of more than 4 minutes (FallbackWindowLookbackSeconds) on the consumer side will be picked up again and executed again
155+
Setting it to true may cause some problems. When the subscription method executes too slowly and takes too long, it will cause the retry thread to pick up messages that have not yet been executed. The retry thread picks up messages from 4 minutes (FallbackWindowLookbackSeconds) ago by default , that is to say, if the message backlog of more than 4 minutes (FallbackWindowLookbackSeconds) on the consumer side will be picked up again and executed again
156+
157+
#### EnablePublishParallelSend
158+
159+
> Default: false, The (7.2 <= Version < 8.1) the default behavior is true
160+
161+
By default, messages sent are first placed into the Channel in memory and then processed linearly.
162+
If set to true, the task of sending messages will be processed in parallel by the .NET thread pool, which will greatly increase the speed of sending.

docs/content/user-guide/en/cap/messaging.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ Retrying plays an important role in the overall CAP architecture design, CAP ret
125125

126126
During the message sending process, when the broker crashes or the connection fails or an abnormality occurs, CAP will retry the sending. Retry 3 times for the first time, retry every minute after 4 minutes (FallbackWindowLookbackSeconds), and +1 retry. When the total number of retries reaches 50, CAP will stop retrying.
127127

128-
You can adjust the total number of retries by setting [FailedRetryCount](../configuration#failedretrycount) in CapOptions Or use [FailedThresholdCallback](../configuration#failedthresholdcallback) to receive notifications when the maximum retry count is reached.
128+
You can adjust the total number of retries by setting [FailedRetryCount](configuration.md#failedretrycount) in CapOptions Or use [FailedThresholdCallback](configuration.md#failedthresholdcallback) to receive notifications when the maximum retry count is reached.
129129

130130
It will stop when the maximum number of times is reached. You can see the reason for the failure in Dashboard and choose whether to manually retry.
131131

@@ -141,10 +141,10 @@ Whether sending fails or consumption fails, we will store the exception message
141141

142142
There is an `ExpiresAt` field in the database message table indicating the expiration time of the message. When the message is sent successfully, status will be changed to `Successed`, and `ExpiresAt` will be set to **1 day** later.
143143

144-
Consuming failure will change the message status to `Failed` and `ExpiresAt` will be set to **15 days** later (You can use [FailedMessageExpiredAfter](../configuration#failedmessageexpiredafter) configuration items to custom).
144+
Consuming failure will change the message status to `Failed` and `ExpiresAt` will be set to **15 days** later (You can use [FailedMessageExpiredAfter](configuration.md#failedmessageexpiredafter) configuration items to custom).
145145

146146
By default, the data of the message in the table is deleted every **5 minutes** to avoid performance degradation caused by too much data. The cleanup strategy `ExpiresAt` is performed when field is not empty and is less than the current time.
147147

148148
That is to say, the message with the status Failed (by default they have been retried 50 times), if you do not have manual intervention for 15 days, it will **also be** cleaned up.
149149

150-
You can use [CollectorCleaningInterval](../configuration#collectorcleaninginterval) configuration items to custom the interval time.
150+
You can use [CollectorCleaningInterval](configuration.md#collectorcleaninginterval) configuration items to custom the interval time.

docs/content/user-guide/en/monitoring/diagnostics.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ dotnet-counters monitor --process-id=25496 --counters=DotNetCore.CAP.EventCounte
7171

7272
process-id: The ID of the CAP process to collect counter data from.
7373

74-
![img](/img/dotnet-counters.gif)
74+
![img](../../../img/dotnet-counters.gif)
7575

7676
### Monitor with dashboard
7777

7878
You can configure `x.UseDashboard()` to open the dashboard to view Metrics graph charts.
7979

80-
![img](/img/dashboard-metrics.gif)
80+
![img](../../../img/dashboard-metrics.gif)
8181

8282
In the Realtime Metric Graph, the time axis will scroll in real time over time so that you can see the rate of publishing and consuming messages per second, And the consumer execution time is "dotted" on the Y1 axis (Y0 axis is the rates, and the Y1 axis is the execution elpsed time).
8383

docs/content/user-guide/en/storage/postgresql.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ public void ConfigureServices(IServiceCollection services)
3232

3333
#### PostgreSqlOptions
3434

35-
NAME | DESCRIPTION | TYPE | DEFAULT
36-
:---|:---|---|:---
37-
Schema | Database schema | string | cap
38-
ConnectionString | Database connection string | string |
35+
NAME | DESCRIPTION | TYPE | DEFAULT
36+
:---|:---------------------------|----------------------|:---
37+
Schema | Database schema | string | cap
38+
ConnectionString | Database connection string | string |
39+
DataSource | [Data source](https://www.npgsql.org/doc/basic-usage.html#data-source) | [NpgsqlDataSource](https://www.npgsql.org/doc/api/Npgsql.NpgsqlDataSource.html) |
3940

4041
## Publish with transaction
4142

docs/content/user-guide/en/transport/aws-sqs.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ public void TestBar(DateTime value)
3232
```
3333
After CAP startups, you will see in SNS management console:
3434

35-
![img](/img/aws-sns-demo.png)
35+
![img](../../../img/aws-sns-demo.png)
3636

3737
### SQS
3838

3939
For each consumer group, CAP will create a corresponding SQS queue, the name of the queue is the name of the `DefaultGroup` in the configuration options, and the queue type is Standard.
4040

4141
The SQS queue will subscribe to Topic in SNS, as shown below:
4242

43-
![img](/img/aws-sns-demo.png)
43+
![img](../../../img/aws-sns-demo.png)
4444

4545
!!! warning "Precautions"
4646
Due to the limitation of AWS SNS, when you remove the subscription method, CAP will not delete topics or queues on AWS SNS or SQS, you need to delete them manually.

docs/content/user-guide/en/transport/azure-service-bus.md

+12-11
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,18 @@ public void ConfigureServices(IServiceCollection services)
3939

4040
The AzureServiceBus configuration options provided directly by the CAP:
4141

42-
| NAME | DESCRIPTION | TYPE | DEFAULT |
43-
| :---------------------- | :------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------- | :---------------- |
44-
| ConnectionString | Endpoint address | string | |
45-
| EnableSessions | Enable [Service bus sessions](https://docs.microsoft.com/en-us/azure/service-bus-messaging/message-sessions) | bool | false |
46-
| TopicPath | Topic entity path | string | cap |
47-
| SubscriptionAutoDeleteOnIdle | Automatically delete subscription after a certain idle interval. | TimeSpan | TimeSpan.MaxValue |
48-
| ManagementTokenProvider | Token provider | ITokenProvider | null |
49-
| AutoCompleteMessages | Gets a value that indicates whether the processor should automatically complete messages after the message handler has completed processing | bool | false |
50-
| CustomHeaders | Adds custom and/or mandatory Headers for incoming messages from heterogeneous systems. | `Func<Message, List<KeyValuePair<string, string>>>?` | null |
51-
| Namespace | Namespace of Servicebus , Needs to be set when using with TokenCredential Property | string | null |
52-
| SQLFilters | Custom SQL Filters by name and expression on Topic Subscribtion | List<KeyValuePair<string, string>> | null |
42+
| NAME | DESCRIPTION | TYPE | DEFAULT |
43+
|:------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------|:----------------------------------|
44+
| ConnectionString | Endpoint address | string | |
45+
| EnableSessions | Enable [Service bus sessions](https://docs.microsoft.com/en-us/azure/service-bus-messaging/message-sessions) | bool | false |
46+
| TopicPath | Topic entity path | string | cap |
47+
| SubscriptionAutoDeleteOnIdle | Automatically delete subscription after a certain idle interval. | TimeSpan | TimeSpan.MaxValue |
48+
| ManagementTokenProvider | Token provider | ITokenProvider | null |
49+
| AutoCompleteMessages | Gets a value that indicates whether the processor should automatically complete messages after the message handler has completed processing | bool | false |
50+
| CustomHeaders | Adds custom and/or mandatory Headers for incoming messages from heterogeneous systems. | `Func<Message, List<KeyValuePair<string, string>>>?` | null |
51+
| Namespace | Namespace of Servicebus , Needs to be set when using with TokenCredential Property | string | null |
52+
| DefaultCorrelationHeaders | Adds additional correlation properties to all [correlation filters](https://learn.microsoft.com/en-us/azure/service-bus-messaging/topic-filters#correlation-filters). | IDictionary<string, string> | Dictionary<string, string>.Empty |
53+
| SQLFilters | Custom SQL Filters by name and expression on Topic Subscribtion | List<KeyValuePair<string, string>> | null |
5354

5455
#### Sessions
5556

docs/content/user-guide/en/transport/kafka.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ CustomHeaders | Custom subscribe headers | Func<> | N/A
4646

4747
When the message sent from a heterogeneous system, because of the CAP needs to define additional headers, so an exception will occur at this time. By providing this parameter to set the custom headersn to make the subscriber works.
4848

49-
You can find the description of heterogeneous system integration [here](../../cap/messaging#heterogeneous-system-integration).
49+
You can find the description of heterogeneous system integration [here](../cap/messaging.md#heterogeneous-system-integration).
5050

5151
Sometimes, if you want to get additional context information from Broker, you can also add it through this option. For example, add information such as Offset or Partition.
5252

docs/content/user-guide/en/transport/nats.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ NAME | DESCRIPTION | TYPE | DEFAULT
4141
Options | NATS client configuration | Options | Options
4242
Servers | Server url/urls used to connect to the NATs server. | string | NULL
4343
ConnectionPoolSize | number of connections pool | uint | 10
44-
DeliverPolicy | The point in the stream to receive messages from | enum | DeliverPolicy.New
44+
DeliverPolicy | The point in the stream to receive messages from (⚠️ Removed from version 8.1.0, use `ConsumerOptions` instead.) | enum | DeliverPolicy.New
45+
StreamOptions | 🆕 Stream configuration | Action | NULL
46+
ConsumerOptions | 🆕 Consumer configuration | Action | NULL
4547

4648
#### NATS ConfigurationOptions
4749

docs/content/user-guide/en/transport/rabbitmq.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ services.AddCap(x =>
7474

7575
When the message sent from the RabbitMQ management console or a heterogeneous system, because of the CAP needs to define additional headers, so an exception will occur at this time. By providing this parameter to set the custom headersn to make the subscriber works.
7676

77-
You can find the description of [Header Information](../cap/messaging#heterogeneous-system-integration) here.
77+
You can find the description of [Header Information](../cap/messaging.md#heterogeneous-system-integration) here.
7878

7979
Example:
8080

docs/content/user-guide/zh/cap/configuration.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,11 @@ services.AddCap(config =>
156156
如果设置为 true, 消费端会将消息预取到内存队列,然后再放入.NET 线程池并行执行。
157157

158158
!!! note "注意事项"
159-
设置为 true 可能会产生一些问题,当订阅方法执行过慢耗时太久时,会导致重试线程拾取到还未执行的的消息。重试线程默认拾取4分钟前(FallbackWindowLookbackSeconds 配置项)的消息,也就是说如果消费端积压了超过4分钟(FallbackWindowLookbackSeconds 配置项)的消息就会被重新拾取到再次执行
159+
设置为 true 可能会产生一些问题,当订阅方法执行过慢耗时太久时,会导致重试线程拾取到还未执行的的消息。重试线程默认拾取4分钟前(FallbackWindowLookbackSeconds 配置项)的消息,也就是说如果消费端积压了超过4分钟(FallbackWindowLookbackSeconds 配置项)的消息就会被重新拾取到再次执行
160+
161+
#### EnablePublishParallelSend
162+
163+
> 默认值: false
164+
165+
默认情况下,发送的消息都先放置到内存同一个Channel中,然后线性处理。
166+
如果设置为 true,则发送消息的任务将由.NET线程池并行处理,这会大大提高发送的速度。

docs/content/user-guide/zh/cap/messaging.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ CAP 接收到消息之后会将消息进行 Persistent(持久化), 有关
116116

117117
在消息发送过程中,当出现 Broker 宕机或者连接失败的情况亦或者出现异常的情况下,这个时候 CAP 会对发送的重试,第一次重试次数为 3,4分钟后以后每分钟重试一次,进行次数 +1,当总次数达到50次后,CAP将不对其进行重试。
118118

119-
你可以在 CapOptions 中设置 [FailedRetryCount](../configuration#failedretrycount) 来调整默认重试的总次数,或使用 [FailedThresholdCallback](../configuration#FailedThresholdCallback) 在达到最大重试次数时收到通知。
119+
你可以在 CapOptions 中设置 [FailedRetryCount](configuration.md#failedretrycount) 来调整默认重试的总次数,或使用 [FailedThresholdCallback](configuration.md#FailedThresholdCallback) 在达到最大重试次数时收到通知。
120120

121121
当失败总次数达到默认失败总次数后,就不会进行重试了,你可以在 Dashboard 中查看消息失败的原因,然后进行人工重试处理。
122122

@@ -128,7 +128,7 @@ CAP 接收到消息之后会将消息进行 Persistent(持久化), 有关
128128

129129
## 消息数据清理
130130

131-
数据库消息表中具有一个 ExpiresAt 字段表示消息的过期时间,当消息发送成功或者消费成功后,CAP会将消息状态为 Successed 的 ExpiresAt 设置为 1天 后过期,会将消息状态为 Failed 的 ExpiresAt 设置为 15天 后过期(可通过 [FailedMessageExpiredAfter](../configuration#failedmessageexpiredafter) 配置)。
131+
数据库消息表中具有一个 ExpiresAt 字段表示消息的过期时间,当消息发送成功或者消费成功后,CAP会将消息状态为 Successed 的 ExpiresAt 设置为 1天 后过期,会将消息状态为 Failed 的 ExpiresAt 设置为 15天 后过期(可通过 [FailedMessageExpiredAfter](configuration.md#failedmessageexpiredafter) 配置)。
132132

133-
CAP 默认情况下会每隔**5分钟**将消息表的数据进行清理删除,避免数据量过多导致性能的降低。清理规则为 ExpiresAt 不为空并且小于当前时间的数据。 也就是说状态为Failed的消息(正常情况他们已经被重试了 50 次),如果你15天没有人工介入处理,同样会被清理掉。你可以通过 [CollectorCleaningInterval](../configuration#collectorcleaninginterval) 配置项来自定义间隔时间。
133+
CAP 默认情况下会每隔**5分钟**将消息表的数据进行清理删除,避免数据量过多导致性能的降低。清理规则为 ExpiresAt 不为空并且小于当前时间的数据。 也就是说状态为Failed的消息(正常情况他们已经被重试了 50 次),如果你15天没有人工介入处理,同样会被清理掉。你可以通过 [CollectorCleaningInterval](configuration.md#collectorcleaninginterval) 配置项来自定义间隔时间。
134134

docs/content/user-guide/zh/monitoring/diagnostics.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ dotnet-counters monitor --process-id=25496 --counters=DotNetCore.CAP.EventCounte
6565

6666
其中 process-id 为 CAP 所属的进程Id。
6767

68-
![img](/img/dotnet-counters.gif)
68+
![img](../../../img/dotnet-counters.gif)
6969

7070
### 在 Dashboard 中查看度量
7171

7272
你可以配置 `x.UseDashboard()` 来开启仪表盘以图表的形式查看 Metrics 指标。 如下图:
7373

74-
![img](/img/dashboard-metrics.gif)
74+
![img](../../../img/dashboard-metrics.gif)
7575

7676

7777
在 Realtime Metric Graph 中,时间轴会随着时间实时滚动从而可以看到发布和消费消息每秒的速率,同时我们可以看到消费者执行耗时以“打点”的方式在 Y1 轴上(Y0轴为速率,Y1轴为执行耗时)。

docs/content/user-guide/zh/storage/postgresql.md

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ NAME | DESCRIPTION | TYPE | DEFAULT
3737
:---|:---|---|:---
3838
Schema | 数据库架构 | string | cap
3939
ConnectionString | 数据库连接字符串 | string |
40+
DataSource | [Data source](https://www.npgsql.org/doc/basic-usage.html#data-source) | [NpgsqlDataSource](https://www.npgsql.org/doc/api/Npgsql.NpgsqlDataSource.html) |
4041

4142
### 自定义表名称
4243

0 commit comments

Comments
 (0)