You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
13
+
CAP is a library based on .Net standard, which is a solution to deal with distributed transactions, has the function of EventBus, it is lightweight, easy to use, and efficient.
14
14
15
-
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.
15
+
In the process of building an SOA or MicroService system, we usually need to use the event to integrate each service. In the process, simple use of message queue does not guarantee reliability. CAP adopts local message table program integrated with the current database to solve exceptions that 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.
16
16
17
-
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.
17
+
You can also use CAP as an EventBus. CAP provides a simpler way to implement event publishing and subscriptions. You do not need to inherit or implement any interface during subscription and sending process.
18
18
19
19
## Architecture overview
20
20
@@ -26,18 +26,19 @@ You can also use the CAP as an EventBus. The CAP provides a simpler way to imple
26
26
27
27
### NuGet
28
28
29
-
You can run the following command to install the CAP in your project.
29
+
CAP can be installed in your project with the following command.
30
30
31
31
```
32
32
PM> Install-Package DotNetCore.CAP
33
33
```
34
34
35
-
CAP supports RabbitMQ,Kafka and AzureServiceas message queue, select the packages you need to install:
35
+
CAP supports RabbitMQ,Kafka, AzureService, AmazonSQS as message queue, following packages are available to install:
@@ -187,15 +189,30 @@ public void ConfigureServices(IServiceCollection services)
187
189
});
188
190
}
189
191
```
192
+
#### Use partials for topic subscriptions
193
+
194
+
To group topic subscriptions on class level you're able to define a subscription on a method as a partial. Subscriptions on the message queue will then be a combination of the topic defined on the class and the topic defined on the method. In the following example the `Create(..)` function will be invoked when receiving a message on `customers.create`
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.
194
211
195
-
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.
212
+
When CAP startups, it will use the current assembly name as the default group name, if multiple same group subscribers subscribe to the same topic name, there is only one subscriber that can receive the message.
196
213
Conversely, if subscribers are in different groups, they will all receive messages.
197
214
198
-
In the same application, you can specify the `Group` property to keep they are in different subscribe groups:
215
+
In the same application, you can specify `Group` property to keep subscriptions in different subscribe groups:
199
216
200
217
```C#
201
218
@@ -212,7 +229,7 @@ public void ShowTime2(DateTime datetime)
212
229
```
213
230
`ShowTime1` and `ShowTime2` will be called at the same time.
214
231
215
-
BTW, You can specify the default group name in the configuration:
232
+
BTW, You can specify the default group name in the configuration:
216
233
217
234
```C#
218
235
services.AddCap(x=>
@@ -224,13 +241,13 @@ services.AddCap(x =>
224
241
225
242
### Dashboard
226
243
227
-
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. Use the following command to install the Dashboard in your project.
244
+
CAP v2.1+ provides dashboard pages, you can easily view messages that were sent and received. In addition, you can also view the message status in real time in the dashboard. Use the following command to install the Dashboard in your project.
228
245
229
246
```
230
247
PM> Install-Package DotNetCore.CAP.Dashboard
231
248
```
232
249
233
-
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.
250
+
In the distributed environment, the dashboard built-in integrates[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.
234
251
235
252
```c#
236
253
services.AddCap(x=>
@@ -253,7 +270,7 @@ services.AddCap(x =>
253
270
});
254
271
```
255
272
256
-
The default dashboard address is :[http://localhost:xxx/cap](http://localhost:xxx/cap), you can also configure the `/cap` suffix with `x.UseDashboard(opt =>{ opt.MatchPath="/mycap"; })`.
273
+
The default dashboard address is :[http://localhost:xxx/cap](http://localhost:xxx/cap), you can configure relative path `/cap` with `x.UseDashboard(opt =>{ opt.MatchPath="/mycap"; })`.
0 commit comments