From 97a450b83a97e7d35106e02a7827a4be3d5daac3 Mon Sep 17 00:00:00 2001 From: Savorboard Date: Tue, 12 Feb 2019 18:03:11 +0800 Subject: [PATCH] Normalized document --- docs/index.md | 16 +++++----- docs/user-guide/api-interface.md | 4 +-- docs/user-guide/faq.md | 53 +++++++++++++++++--------------- mkdocs.yml | 6 ++-- 4 files changed, 42 insertions(+), 37 deletions(-) diff --git a/docs/index.md b/docs/index.md index 7390068..e1aefa8 100644 --- a/docs/index.md +++ b/docs/index.md @@ -8,12 +8,15 @@ In the process of building an SOA or MicroService system, we usually need to use 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: +!!! Tip "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.png](img/architecture.png) + > Atomicity when publishing events to the event bus with a worker microservice -!!! note - 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). + +For detailed instructions see the [getting started guide][1]. + + [1]: user-guide/getting-started.md ## Contributing @@ -21,9 +24,8 @@ One of the easiest ways to contribute is to participate in discussions and discu If you have any question or problems, please report them on the CAP repository: - - - + + ## License CAP is licensed under the [MIT license](https://github.com/dotnetcore/CAP/blob/master/LICENSE.txt). diff --git a/docs/user-guide/api-interface.md b/docs/user-guide/api-interface.md index 2fe5a1b..4f2a1e6 100644 --- a/docs/user-guide/api-interface.md +++ b/docs/user-guide/api-interface.md @@ -177,12 +177,12 @@ The following situations you shoud be aware of. **① the subscription side has not started yet when publishing a message** -#### Kafka: +#### Kafka In Kafka,published messages stored in the Persistent log files,so messages will not lost.when the subscription side started,it can still consume the message. -#### RabbitMQ: +#### RabbitMQ In RabbitMQ, the application will create Persistent Exchange and Queue at the **first start**, CAP will create a new consumer queue for each consumer group,**because the application started but the subscription side hasn's start yet so there has no queue,thus the message can not be persited,and the published messages will lost** diff --git a/docs/user-guide/faq.md b/docs/user-guide/faq.md index 39a9462..1715ca2 100644 --- a/docs/user-guide/faq.md +++ b/docs/user-guide/faq.md @@ -1,41 +1,44 @@ # FAQ -## Any IM group(e.g Tencent QQ group) to learn and chat about CAP? +!!! faq "Any IM group(e.g Tencent QQ group) to learn and chat about CAP?" -None for that. Better than wasting much time in IM group, I hope developers could be capable of independent thinking more, and solve problems yourselves with referenced documents, even create issues or send emails when errors are remaining present. + None for that. Better than wasting much time in IM group, I hope developers could be capable of independent thinking more, and solve problems yourselves with referenced documents, even create issues or send emails when errors are remaining present. -## Does it require certain different databases, one each for productor and resumer in CAP? +!!! faq "Does it require certain different databases, one each for productor and resumer in CAP?" -Not requird differences necessary, a given advice is that using a special database for each program. + Not requird differences necessary, a given advice is that using a special database for each program. -Otherwise, look at Q&A below. + Otherwise, look at Q&A below. -## How to use the same database for different programs? +!!! faq "How to use the same database for different applications?" -defining a prefix name of table in `ConfigureServices` method。 - -codes exsample: + defining a prefix name of table in `ConfigureServices` method。 + + codes exsample: -```c# -public void ConfigureServices(IServiceCollection services) -{ - services.AddCap(x => + ```c# + public void ConfigureServices(IServiceCollection services) { - x.UseKafka(""); - x.UseMySql(opt => + services.AddCap(x => { - opt.ConnectionString = "connection string"; - opt.TableNamePrefix = "appone"; // different table name prefix here + x.UseKafka(""); + x.UseMySql(opt => + { + opt.ConnectionString = "connection string"; + opt.TableNamePrefix = "appone"; // different table name prefix here + }); }); - }); -} -``` + } + ``` -!!!NOTE - Different prefixed names cause SLB to no effect. +!!! faq "Can CAP not use the database as event storage? I just want to sent the message" -## If don't care about message missing, can message productor exist without any database, for the reason of sending message only. + Not yet. -Not yet. + The purpose of CAP is that ensure consistency principle right in microservice or SOA architechtrues. The solution is based on ACID features of database, there is no sense about a single client wapper of message queue without database. -The purpose of CAP is that ensure consistency principle right in microservice or SOA architechtrues. The solution is based on ACID features of database, there is no sense about a single client wapper of message queue without database. +!!! faq "If the consumer is abnormal, can I roll back the database executed sql that the producer has executed?" + + Can't roll back, CAP is the ultimate consistency solution. + + You can imagine your scenario is to call a third party payment. If you are doing a third-party payment operation, after calling Alipay's interface successfully, and your own code is wrong, will Alipay roll back? If you don't roll back, what should you do? The same is true here. \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 1fbbc00..f96eb74 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,10 +1,10 @@ # Project information site_name: CAP -site_url: https://cap.dotnet-chain.com +site_url: https://cap.dotnet-china.com site_description: Project documentation with Markdown. site_author: CAP Team repo_name: 'dotnetcore/CAP' -repo_url: 'https://github.com/dotnetcore/cap' +repo_url: 'https://github.com/dotnetcore/cap/' # Copyright copyright: Copyright © 2017 .NET Core Community, Maintained by the CAP Team. @@ -47,7 +47,7 @@ theme: #Customization extra: manifest: 'manifest.webmanifest' - disqus: 'cap-1' + #disqus: 'cap-1' social: - type: 'github' link: 'https://github.com/dotnetcore/cap'