Browse Source

Normalized document

master
Savorboard 5 years ago
parent
commit
97a450b83a
4 changed files with 42 additions and 37 deletions
  1. +9
    -7
      docs/index.md
  2. +2
    -2
      docs/user-guide/api-interface.md
  3. +28
    -25
      docs/user-guide/faq.md
  4. +3
    -3
      mkdocs.yml

+ 9
- 7
docs/index.md View File

@@ -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)"
<img src="https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/multi-container-microservice-net-applications/media/image24.png">

![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:

<a href="https://github.com/dotnetcore/cap/issues/new"><button class="btn btn-primary btn-lg" type="submit"><i class="fab fa-github fa-2x"></i> Report Issue</button></a>
<a href="https://github.com/dotnetcore/cap/issues"><button class="btn btn-primary btn-lg" type="submit"> Active Issues <i class="fab fa-github fa-2x"></i></button></a>

<a href="https://github.com/dotnetcore/cap/issues/new"><button data-md-color-primary="purple"><i class="fa fa-github fa-2x"></i> Report Issue</button></a>
<a href="https://github.com/dotnetcore/cap/issues"><button data-md-color-primary="purple" type="submit"> Active Issues <i class="fa fa-github fa-2x"></i></button></a>
## License

CAP is licensed under the [MIT license](https://github.com/dotnetcore/CAP/blob/master/LICENSE.txt).

+ 2
- 2
docs/user-guide/api-interface.md View File

@@ -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**



+ 28
- 25
docs/user-guide/faq.md View File

@@ -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.

+ 3
- 3
mkdocs.yml View File

@@ -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 &copy; 2017 <a href="https://github.com/dotnetcore">.NET Core Community</a>, Maintained by the <a href="/about/contact-us/#cap-team">CAP Team</a>.
@@ -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'


Loading…
Cancel
Save