Commit b877aa78 authored by Savorboard's avatar Savorboard

Deployed c0a43b5f with MkDocs version: 1.0.4

parent 14d74eb1
......@@ -371,7 +371,7 @@
<li class="md-nav__item">
<a href="user-guide/design-principle/" title="Design Principle" class="md-nav__link">
<a href="user-guide/design/" title="Design Principle" class="md-nav__link">
Design Principle
</a>
</li>
......@@ -383,7 +383,7 @@
<li class="md-nav__item">
<a href="user-guide/implementation-mechanisms/" title="Implementation Mechanisms" class="md-nav__link">
<a href="user-guide/implementation/" title="Implementation Mechanisms" class="md-nav__link">
Implementation Mechanisms
</a>
</li>
......@@ -395,7 +395,7 @@
<li class="md-nav__item">
<a href="user-guide/distributed-transactions/" title="Distributed Transactions" class="md-nav__link">
<a href="user-guide/transaction/" title="Distributed Transactions" class="md-nav__link">
Distributed Transactions
</a>
</li>
......
......@@ -379,7 +379,7 @@
<li class="md-nav__item">
<a href="../../user-guide/design-principle/" title="Design Principle" class="md-nav__link">
<a href="../../user-guide/design/" title="Design Principle" class="md-nav__link">
Design Principle
</a>
</li>
......@@ -391,7 +391,7 @@
<li class="md-nav__item">
<a href="../../user-guide/implementation-mechanisms/" title="Implementation Mechanisms" class="md-nav__link">
<a href="../../user-guide/implementation/" title="Implementation Mechanisms" class="md-nav__link">
Implementation Mechanisms
</a>
</li>
......@@ -403,7 +403,7 @@
<li class="md-nav__item">
<a href="../../user-guide/distributed-transactions/" title="Distributed Transactions" class="md-nav__link">
<a href="../../user-guide/transaction/" title="Distributed Transactions" class="md-nav__link">
Distributed Transactions
</a>
</li>
......@@ -590,6 +590,8 @@
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
<label class="md-nav__link md-nav__link--active" for="__toc">
Contact Us
......@@ -603,20 +605,22 @@
<nav class="md-nav md-nav--secondary">
<label class="md-nav__title" for="__toc">Table of contents</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="#contact-us" title="Contact Us" class="md-nav__link">
Contact Us
<a href="#authors" title="Authors" class="md-nav__link">
Authors
</a>
</li>
<li class="md-nav__item">
<a href="#cap-team" title="CAP Team" class="md-nav__link">
CAP Team
<a href="#ncc-organization" title="NCC Organization" class="md-nav__link">
NCC Organization
</a>
</li>
......@@ -651,20 +655,22 @@
<nav class="md-nav md-nav--secondary">
<label class="md-nav__title" for="__toc">Table of contents</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="#contact-us" title="Contact Us" class="md-nav__link">
Contact Us
<a href="#authors" title="Authors" class="md-nav__link">
Authors
</a>
</li>
<li class="md-nav__item">
<a href="#cap-team" title="CAP Team" class="md-nav__link">
CAP Team
<a href="#ncc-organization" title="NCC Organization" class="md-nav__link">
NCC Organization
</a>
</li>
......@@ -688,14 +694,19 @@
<a href="https://github.com/dotnetcore/cap/edit/master/docs/about/contact-us.md" title="Edit this page" class="md-icon md-content__icon">&#xE3C9;</a>
<h1>Contact Us</h1>
<h2 id="contact-us">Contact Us<a class="headerlink" href="#contact-us" title="Permanent link">&para;</a></h2>
<h1 id="contact-us">Contact Us<a class="headerlink" href="#contact-us" title="Permanent link">&para;</a></h1>
<h2 id="authors">Authors<a class="headerlink" href="#authors" title="Permanent link">&para;</a></h2>
<ul>
<li>Submit an issue</li>
<li>Author: <a href="https://github.com/yang-xiaodong">@yang-xiaodong</a></li>
<li>Email: <a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#121;&#97;&#110;&#103;&#120;&#105;&#97;&#111;&#100;&#111;&#110;&#103;&#49;&#50;&#49;&#52;&#64;&#49;&#50;&#54;&#46;&#99;&#111;&#109;">&#121;&#97;&#110;&#103;&#120;&#105;&#97;&#111;&#100;&#111;&#110;&#103;&#49;&#50;&#49;&#52;&#64;&#49;&#50;&#54;&#46;&#99;&#111;&#109;</a></li>
<li>Blogs: <a href="https://saborboard.cnblogs.com">https://saborboard.cnblogs.com</a></li>
</ul>
<h2 id="ncc-organization">NCC Organization<a class="headerlink" href="#ncc-organization" title="Permanent link">&para;</a></h2>
<ul>
<li>Email: <a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#100;&#111;&#116;&#110;&#101;&#116;&#99;&#110;&#64;&#111;&#117;&#116;&#108;&#111;&#111;&#107;&#46;&#99;&#111;&#109;">&#100;&#111;&#116;&#110;&#101;&#116;&#99;&#110;&#64;&#111;&#117;&#116;&#108;&#111;&#111;&#107;&#46;&#99;&#111;&#109;</a></li>
<li>Twitter: <a href="https://twitter.com/ncc_community">https://twitter.com/ncc_community</a></li>
<li>Weibo: <a href="https://weibo.com/dotnetcore">https://weibo.com/dotnetcore</a></li>
</ul>
<h2 id="cap-team">CAP Team<a class="headerlink" href="#cap-team" title="Permanent link">&para;</a></h2>
......
......@@ -108,6 +108,10 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#contributing" tabindex="1" class="md-skip">
Skip to content
</a>
<header class="md-header" data-md-component="header">
<nav class="md-header-nav md-grid">
......@@ -375,7 +379,7 @@
<li class="md-nav__item">
<a href="../../user-guide/design-principle/" title="Design Principle" class="md-nav__link">
<a href="../../user-guide/design/" title="Design Principle" class="md-nav__link">
Design Principle
</a>
</li>
......@@ -387,7 +391,7 @@
<li class="md-nav__item">
<a href="../../user-guide/implementation-mechanisms/" title="Implementation Mechanisms" class="md-nav__link">
<a href="../../user-guide/implementation/" title="Implementation Mechanisms" class="md-nav__link">
Implementation Mechanisms
</a>
</li>
......@@ -399,7 +403,7 @@
<li class="md-nav__item">
<a href="../../user-guide/distributed-transactions/" title="Distributed Transactions" class="md-nav__link">
<a href="../../user-guide/transaction/" title="Distributed Transactions" class="md-nav__link">
Distributed Transactions
</a>
</li>
......@@ -574,6 +578,8 @@
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
<a href="./" title="Contributing" class="md-nav__link md-nav__link--active">
Contributing
......@@ -606,6 +612,21 @@
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary">
</nav>
</div>
</div>
</div>
<div class="md-content">
<article class="md-content__inner md-typeset">
......@@ -614,9 +635,8 @@
<a href="https://github.com/dotnetcore/cap/edit/master/docs/about/contributing.md" title="Edit this page" class="md-icon md-content__icon">&#xE3C9;</a>
<h1>Contributing</h1>
<h1 id="contributing">Contributing<a class="headerlink" href="#contributing" title="Permanent link">&para;</a></h1>
<p>Pull requests, issues and commentary welcome! No special process just create a request and get in touch either via gitter or create an issue.</p>
......
This diff is collapsed.
......@@ -429,7 +429,7 @@
<li class="md-nav__item">
<a href="user-guide/design-principle/" title="Design Principle" class="md-nav__link">
<a href="user-guide/design/" title="Design Principle" class="md-nav__link">
Design Principle
</a>
</li>
......@@ -441,7 +441,7 @@
<li class="md-nav__item">
<a href="user-guide/implementation-mechanisms/" title="Implementation Mechanisms" class="md-nav__link">
<a href="user-guide/implementation/" title="Implementation Mechanisms" class="md-nav__link">
Implementation Mechanisms
</a>
</li>
......@@ -453,7 +453,7 @@
<li class="md-nav__item">
<a href="user-guide/distributed-transactions/" title="Distributed Transactions" class="md-nav__link">
<a href="user-guide/transaction/" title="Distributed Transactions" class="md-nav__link">
Distributed Transactions
</a>
</li>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -21,17 +21,17 @@
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://cap.dotnet-chain.org/user-guide/design-principle/</loc>
<loc>https://cap.dotnet-chain.org/user-guide/design/</loc>
<lastmod>2019-02-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://cap.dotnet-chain.org/user-guide/implementation-mechanisms/</loc>
<loc>https://cap.dotnet-chain.org/user-guide/implementation/</loc>
<lastmod>2019-02-12</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://cap.dotnet-chain.org/user-guide/distributed-transactions/</loc>
<loc>https://cap.dotnet-chain.org/user-guide/transaction/</loc>
<lastmod>2019-02-12</lastmod>
<changefreq>daily</changefreq>
</url>
......
No preview for this file type
This diff is collapsed.
......@@ -379,7 +379,7 @@
<li class="md-nav__item">
<a href="../../user-guide/design-principle/" title="Design Principle" class="md-nav__link">
<a href="../../user-guide/design/" title="Design Principle" class="md-nav__link">
Design Principle
</a>
</li>
......@@ -391,7 +391,7 @@
<li class="md-nav__item">
<a href="../../user-guide/implementation-mechanisms/" title="Implementation Mechanisms" class="md-nav__link">
<a href="../../user-guide/implementation/" title="Implementation Mechanisms" class="md-nav__link">
Implementation Mechanisms
</a>
</li>
......@@ -403,7 +403,7 @@
<li class="md-nav__item">
<a href="../../user-guide/distributed-transactions/" title="Distributed Transactions" class="md-nav__link">
<a href="../../user-guide/transaction/" title="Distributed Transactions" class="md-nav__link">
Distributed Transactions
</a>
</li>
......@@ -790,10 +790,13 @@
<p>CAP 使用 Microsoft.Extensions.DependencyInjection 进行配置的注入,你也可以依赖于 DI 从json文件中读取配置。</p>
<h3 id="cap-options">Cap Options<a class="headerlink" href="#cap-options" title="Permanent link">&para;</a></h3>
<p>你可以使用如下方式来配置 CAP 中的一些配置项,例如</p>
<div class="codehilite"><pre><span></span>services.AddCap(capOptions =&gt; {
<table class="codehilitetable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span>1
2
3</pre></div></td><td class="code"><div class="codehilite"><pre><span></span>services.AddCap(capOptions =&gt; {
capOptions.FailedCallback = //...
});
</pre></div>
</td></tr></table>
<p><code class="codehilite">CapOptions</code> 提供了以下配置项:</p>
<table>
......@@ -842,12 +845,17 @@
<p>FailedCallback 的类型为 <code class="codehilite">Action&lt;MessageType,string,string&gt;</code>,第一个参数为消息类型(发送的还是接收的),第二个参数为消息的名称(name),第三个参数为消息的内容(content)。</p>
<h3 id="rabbitmq-options">RabbitMQ Options<a class="headerlink" href="#rabbitmq-options" title="Permanent link">&para;</a></h3>
<p>CAP 采用的是针对 CapOptions 进行扩展来实现RabbitMQ的配置功能,所以针对 RabbitMQ 的配置用法如下:</p>
<div class="codehilite"><pre><span></span>services.AddCap(capOptions =&gt; {
<table class="codehilitetable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span>1
2
3
4
5</pre></div></td><td class="code"><div class="codehilite"><pre><span></span>services.AddCap(capOptions =&gt; {
capOptions.UseRabbitMQ(rabbitMQOption=&gt;{
// rabbitmq options.
});
});
</pre></div>
</td></tr></table>
<p><code class="codehilite">RabbitMQOptions</code> 提供了有关RabbitMQ相关的配置:</p>
<table>
......@@ -924,19 +932,31 @@
</table>
<h3 id="kafka-options">Kafka Options<a class="headerlink" href="#kafka-options" title="Permanent link">&para;</a></h3>
<p>CAP 采用的是针对 CapOptions 进行扩展来实现 Kafka 的配置功能,所以针对 Kafka 的配置用法如下:</p>
<div class="codehilite"><pre><span></span>services.AddCap(capOptions =&gt; {
<table class="codehilitetable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span>1
2
3
4
5
6</pre></div></td><td class="code"><div class="codehilite"><pre><span></span>services.AddCap(capOptions =&gt; {
capOptions.UseKafka(kafkaOption=&gt;{
// kafka options.
// kafkaOptions.MainConfig.Add(&quot;&quot;, &quot;&quot;);
});
});
</pre></div>
</td></tr></table>
<p><code class="codehilite">KafkaOptions</code> 提供了有关 Kafka 相关的配置,由于Kafka的配置比较多,所以此处使用的是提供的 MainConfig 字典来支持进行自定义配置,你可以查看这里来获取对配置项的支持信息。</p>
<p><a href="https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md">https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md</a></p>
<h3 id="entityframework-options">EntityFramework Options<a class="headerlink" href="#entityframework-options" title="Permanent link">&para;</a></h3>
<p>如果使用的 Entityframework 来作为消息持久化存储的话,那么你可以在配置 CAP EntityFramework 配置项的时候来自定义一些配置。</p>
<div class="codehilite"><pre><span></span>services.AddCap(x =&gt;
<table class="codehilitetable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span>1
2
3
4
5
6
7</pre></div></td><td class="code"><div class="codehilite"><pre><span></span>services.AddCap(x =&gt;
{
x.UseEntityFramework&lt;AppDbContext&gt;(efOption =&gt;
{
......@@ -944,6 +964,7 @@
});
});
</pre></div>
</td></tr></table>
<p>注意,如果你使用了 <code class="codehilite">UseEntityFramework</code> 的配置项,那么你不需要再次配置下面的章节几个针对不同数据库的配置,CAP 将会自动读取 DbContext 中使用的数据库相关配置信息。</p>
<table>
......@@ -979,12 +1000,17 @@
<h3 id="sqlserver-options">SqlServer Options<a class="headerlink" href="#sqlserver-options" title="Permanent link">&para;</a></h3>
<p>注意,如果你使用的是 EntityFramewrok,你用不到此配置项。</p>
<p>CAP 采用的是针对 CapOptions 进行扩展来实现 SqlServer 的配置功能,所以针对 SqlServer 的配置用法如下:</p>
<div class="codehilite"><pre><span></span>services.AddCap(capOptions =&gt; {
<table class="codehilitetable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span>1
2
3
4
5</pre></div></td><td class="code"><div class="codehilite"><pre><span></span>services.AddCap(capOptions =&gt; {
capOptions.UseSqlServer(sqlserverOptions =&gt; {
// sqlserverOptions.ConnectionString
});
});
</pre></div>
</td></tr></table>
<table>
<thead>
......@@ -1013,12 +1039,17 @@
<h3 id="mysql-options">MySql Options<a class="headerlink" href="#mysql-options" title="Permanent link">&para;</a></h3>
<p>注意,如果你使用的是 EntityFramewrok,你用不到此配置项。</p>
<p>CAP 采用的是针对 CapOptions 进行扩展来实现 MySql 的配置功能,所以针对 MySql 的配置用法如下:</p>
<div class="codehilite"><pre><span></span>services.AddCap(capOptions =&gt; {
<table class="codehilitetable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span>1
2
3
4
5</pre></div></td><td class="code"><div class="codehilite"><pre><span></span>services.AddCap(capOptions =&gt; {
capOptions.UseMySql(mysqlOptions =&gt; {
// mysqlOptions.ConnectionString
});
});
</pre></div>
</td></tr></table>
<table>
<thead>
......@@ -1047,12 +1078,17 @@
<h3 id="postgresql-options">PostgreSql Options<a class="headerlink" href="#postgresql-options" title="Permanent link">&para;</a></h3>
<p>注意,如果你使用的是 EntityFramewrok,你用不到此配置项。</p>
<p>CAP 采用的是针对 CapOptions 进行扩展来实现 PostgreSql 的配置功能,所以针对 PostgreSql 的配置用法如下:</p>
<div class="codehilite"><pre><span></span>services.AddCap(capOptions =&gt; {
<table class="codehilitetable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span>1
2
3
4
5</pre></div></td><td class="code"><div class="codehilite"><pre><span></span>services.AddCap(capOptions =&gt; {
capOptions.UsePostgreSql(postgreOptions =&gt; {
// postgreOptions.ConnectionString
});
});
</pre></div>
</td></tr></table>
<table>
<thead>
......
......@@ -379,7 +379,7 @@
<li class="md-nav__item">
<a href="../../user-guide/design-principle/" title="Design Principle" class="md-nav__link">
<a href="../../user-guide/design/" title="Design Principle" class="md-nav__link">
Design Principle
</a>
</li>
......@@ -391,7 +391,7 @@
<li class="md-nav__item">
<a href="../../user-guide/implementation-mechanisms/" title="Implementation Mechanisms" class="md-nav__link">
<a href="../../user-guide/implementation/" title="Implementation Mechanisms" class="md-nav__link">
Implementation Mechanisms
</a>
</li>
......@@ -403,7 +403,7 @@
<li class="md-nav__item">
<a href="../../user-guide/distributed-transactions/" title="Distributed Transactions" class="md-nav__link">
<a href="../../user-guide/transaction/" title="Distributed Transactions" class="md-nav__link">
Distributed Transactions
</a>
</li>
......
......@@ -379,7 +379,7 @@
<li class="md-nav__item">
<a href="../../user-guide/design-principle/" title="Design Principle" class="md-nav__link">
<a href="../../user-guide/design/" title="Design Principle" class="md-nav__link">
Design Principle
</a>
</li>
......@@ -391,7 +391,7 @@
<li class="md-nav__item">
<a href="../../user-guide/implementation-mechanisms/" title="Implementation Mechanisms" class="md-nav__link">
<a href="../../user-guide/implementation/" title="Implementation Mechanisms" class="md-nav__link">
Implementation Mechanisms
</a>
</li>
......@@ -403,7 +403,7 @@
<li class="md-nav__item">
<a href="../../user-guide/distributed-transactions/" title="Distributed Transactions" class="md-nav__link">
<a href="../../user-guide/transaction/" title="Distributed Transactions" class="md-nav__link">
Distributed Transactions
</a>
</li>
......
......@@ -375,7 +375,7 @@
<li class="md-nav__item">
<a href="../../user-guide/design-principle/" title="Design Principle" class="md-nav__link">
<a href="../../user-guide/design/" title="Design Principle" class="md-nav__link">
Design Principle
</a>
</li>
......@@ -387,7 +387,7 @@
<li class="md-nav__item">
<a href="../../user-guide/implementation-mechanisms/" title="Implementation Mechanisms" class="md-nav__link">
<a href="../../user-guide/implementation/" title="Implementation Mechanisms" class="md-nav__link">
Implementation Mechanisms
</a>
</li>
......@@ -399,7 +399,7 @@
<li class="md-nav__item">
<a href="../../user-guide/distributed-transactions/" title="Distributed Transactions" class="md-nav__link">
<a href="../../user-guide/transaction/" title="Distributed Transactions" class="md-nav__link">
Distributed Transactions
</a>
</li>
......@@ -627,7 +627,18 @@ QQ群有效沟通太低,浪费时间。</p>
<p><strong>3、CAP如何在不同的实例中使用相同的数据库?</strong></p>
<p>如果想在不同的实例(程序)中连接相同的数据库,那么你可以在配置CAP的时候通过指定不同的数据库表名前缀来实现。</p>
<p>你可以通过以下方式来指定数据库表名前缀:</p>
<p><div class="codehilite"><pre><span></span>public void ConfigureServices(IServiceCollection services)
<p><table class="codehilitetable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span> 1
2
3
4
5
6
7
8
9
10
11
12</pre></div></td><td class="code"><div class="codehilite"><pre><span></span>public void ConfigureServices(IServiceCollection services)
{
services.AddCap(x =&gt;
{
......@@ -640,6 +651,7 @@ QQ群有效沟通太低,浪费时间。</p>
});
}
</pre></div>
</td></tr></table>
注意:相同的实例不需要指定不同的表名称前缀,他们在接收消息的时候会进行负载均衡。</p>
<p><strong>4、CAP可以不使用数据库吗? 我仅仅是想通过她来传递消息,我可以接受消息丢失的情况</strong> </p>
<p>目前是不可以的。 </p>
......
......@@ -379,7 +379,7 @@
<li class="md-nav__item">
<a href="../../user-guide/design-principle/" title="Design Principle" class="md-nav__link">
<a href="../../user-guide/design/" title="Design Principle" class="md-nav__link">
Design Principle
</a>
</li>
......@@ -391,7 +391,7 @@
<li class="md-nav__item">
<a href="../../user-guide/implementation-mechanisms/" title="Implementation Mechanisms" class="md-nav__link">
<a href="../../user-guide/implementation/" title="Implementation Mechanisms" class="md-nav__link">
Implementation Mechanisms
</a>
</li>
......@@ -403,7 +403,7 @@
<li class="md-nav__item">
<a href="../../user-guide/distributed-transactions/" title="Distributed Transactions" class="md-nav__link">
<a href="../../user-guide/transaction/" title="Distributed Transactions" class="md-nav__link">
Distributed Transactions
</a>
</li>
......@@ -732,26 +732,59 @@
<li><strong>引用 NuGet 包</strong></li>
</ul>
<p>使用一下命令来引用CAP的NuGet包:</p>
<div class="codehilite"><pre><span></span>PM&gt; Install-Package DotNetCore.CAP
<table class="codehilitetable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span>1</pre></div></td><td class="code"><div class="codehilite"><pre><span></span>PM&gt; Install-Package DotNetCore.CAP
</pre></div>
</td></tr></table>
<p>根据使用的不同类型的消息队列,来引入不同的扩展包:</p>
<div class="codehilite"><pre><span></span>PM&gt; Install-Package DotNetCore.CAP.RabbitMQ
<table class="codehilitetable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span>1
2</pre></div></td><td class="code"><div class="codehilite"><pre><span></span>PM&gt; Install-Package DotNetCore.CAP.RabbitMQ
PM&gt; Install-Package DotNetCore.CAP.Kafka
</pre></div>
</td></tr></table>
<p>根据使用的不同类型的数据库,来引入不同的扩展包:</p>
<div class="codehilite"><pre><span></span>PM&gt; Install-Package DotNetCore.CAP.SqlServer
<table class="codehilitetable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span>1
2
3
4</pre></div></td><td class="code"><div class="codehilite"><pre><span></span>PM&gt; Install-Package DotNetCore.CAP.SqlServer
PM&gt; Install-Package DotNetCore.CAP.MySql
PM&gt; Install-Package DotNetCore.CAP.PostgreSql
PM&gt; Install-Package DotNetCore.CAP.MongoDB
</pre></div>
</td></tr></table>
<ul>
<li><strong>启动配置</strong></li>
</ul>
<p>在 ASP.NET Core 程序中,你可以在 <code class="codehilite">Startup.cs</code> 文件 <code class="codehilite">ConfigureServices()</code> 中配置 CAP 使用到的服务:</p>
<div class="codehilite"><pre><span></span>public void ConfigureServices(IServiceCollection services)
<table class="codehilitetable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27</pre></div></td><td class="code"><div class="codehilite"><pre><span></span>public void ConfigureServices(IServiceCollection services)
{
//......
......@@ -779,6 +812,7 @@ PM&gt; Install-Package DotNetCore.CAP.MongoDB
});
}
</pre></div>
</td></tr></table>
......
......@@ -379,7 +379,7 @@
<li class="md-nav__item">
<a href="../../user-guide/design-principle/" title="Design Principle" class="md-nav__link">
<a href="../../user-guide/design/" title="Design Principle" class="md-nav__link">
Design Principle
</a>
</li>
......@@ -391,7 +391,7 @@
<li class="md-nav__item">
<a href="../../user-guide/implementation-mechanisms/" title="Implementation Mechanisms" class="md-nav__link">
<a href="../../user-guide/implementation/" title="Implementation Mechanisms" class="md-nav__link">
Implementation Mechanisms
</a>
</li>
......@@ -403,7 +403,7 @@
<li class="md-nav__item">
<a href="../../user-guide/distributed-transactions/" title="Distributed Transactions" class="md-nav__link">
<a href="../../user-guide/transaction/" title="Distributed Transactions" class="md-nav__link">
Distributed Transactions
</a>
</li>
......
This diff is collapsed.
This diff is collapsed.
......@@ -13,7 +13,7 @@
<meta name="description" content="Project documentation with Markdown.">
<link rel="canonical" href="https://cap.dotnet-chain.org/user-guide/design-principle/">
<link rel="canonical" href="https://cap.dotnet-chain.org/user-guide/design/">
<meta name="author" content="CAP Team">
......@@ -108,7 +108,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#design-principle" tabindex="1" class="md-skip">
<a href="#design" tabindex="1" class="md-skip">
Skip to content
</a>
......@@ -386,6 +386,8 @@
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
<label class="md-nav__link md-nav__link--active" for="__toc">
Design Principle
......@@ -399,50 +401,39 @@
<nav class="md-nav md-nav--secondary">
<label class="md-nav__title" for="__toc">Table of contents</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="#design-principle" title="Design Principle" class="md-nav__link">
Design Principle
</a>
<nav class="md-nav">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#motivation" title="Motivation" class="md-nav__link">
Motivation
</a>
</li>
<li class="md-nav__item">
<li class="md-nav__item">
<a href="#persistence" title="Persistence" class="md-nav__link">
Persistence
</a>
</li>
<li class="md-nav__item">
<li class="md-nav__item">
<a href="#communication-data-streams" title="Communication Data Streams" class="md-nav__link">
Communication Data Streams
</a>
</li>
<li class="md-nav__item">
<li class="md-nav__item">
<a href="#consistency" title="Consistency" class="md-nav__link">
Consistency
</a>
</li>
</ul>
</nav>
</li>
......@@ -461,7 +452,7 @@
<li class="md-nav__item">
<a href="../implementation-mechanisms/" title="Implementation Mechanisms" class="md-nav__link">
<a href="../implementation/" title="Implementation Mechanisms" class="md-nav__link">
Implementation Mechanisms
</a>
</li>
......@@ -473,7 +464,7 @@
<li class="md-nav__item">
<a href="../distributed-transactions/" title="Distributed Transactions" class="md-nav__link">
<a href="../transaction/" title="Distributed Transactions" class="md-nav__link">
Distributed Transactions
</a>
</li>
......@@ -678,50 +669,39 @@
<nav class="md-nav md-nav--secondary">
<label class="md-nav__title" for="__toc">Table of contents</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="#design-principle" title="Design Principle" class="md-nav__link">
Design Principle
</a>
<nav class="md-nav">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#motivation" title="Motivation" class="md-nav__link">
Motivation
</a>
</li>
<li class="md-nav__item">
<li class="md-nav__item">
<a href="#persistence" title="Persistence" class="md-nav__link">
Persistence
</a>
</li>
<li class="md-nav__item">
<li class="md-nav__item">
<a href="#communication-data-streams" title="Communication Data Streams" class="md-nav__link">
Communication Data Streams
</a>
</li>
<li class="md-nav__item">
<li class="md-nav__item">
<a href="#consistency" title="Consistency" class="md-nav__link">
Consistency
</a>
</li>
</ul>
</nav>
</li>
......@@ -739,17 +719,15 @@
<article class="md-content__inner md-typeset">
<a href="https://github.com/dotnetcore/cap/edit/master/docs/user-guide/design-principle.md" title="Edit this page" class="md-icon md-content__icon">&#xE3C9;</a>
<a href="https://github.com/dotnetcore/cap/edit/master/docs/user-guide/design.md" title="Edit this page" class="md-icon md-content__icon">&#xE3C9;</a>
<h1>Design Principle</h1>
<h2 id="design-principle">Design Principle<a class="headerlink" href="#design-principle" title="Permanent link">&para;</a></h2>
<h3 id="motivation">Motivation<a class="headerlink" href="#motivation" title="Permanent link">&para;</a></h3>
<h1 id="design">Design<a class="headerlink" href="#design" title="Permanent link">&para;</a></h1>
<h2 id="motivation">Motivation<a class="headerlink" href="#motivation" title="Permanent link">&para;</a></h2>
<p>With the popularity of microservices architecture, more and more people are trying to use microservices to architect their systems. In this we encounter problems such as distributed transactions. To solve these problems, I did not find simplicity and Easy to use solution, so I decided to create such a library to solve this problem.</p>
<p>The original CAP was to solve the transaction problems in the distributed system. She used asynchronous to ensure that this weak consistency transaction mechanism achieved the eventual consistency of the distributed transaction. For more information, see section 6.</p>
<p>Now in addition to solving distributed transaction problems, CAP's other important function is to use it as an EventBus. It has all of the features of EventBus and provides a more simplified way to handle publish/subscribe in EventBus.</p>
<h3 id="persistence">Persistence<a class="headerlink" href="#persistence" title="Permanent link">&para;</a></h3>
<h2 id="persistence">Persistence<a class="headerlink" href="#persistence" title="Permanent link">&para;</a></h2>
<p>The CAP relies on the local database for persistence of messages. The CAP uses this method to deal with situations in which all messages are lost due to environmental or network anomalies. The reliability of messages is the cornerstone of distributed transactions, so messages cannot be lost under any circumstances.</p>
<p>There are two types of persistence for messages:</p>
<p><strong>1 Persistence before the message enters the message queue</strong></p>
......@@ -759,7 +737,7 @@
<p>After the message enters the message queue, the CAP starts the persistence function of the message queue. We need to explain how the message of the CAP in RabbitMQ and Kafka is persistent.</p>
<p>For message persistence in RabbitMQ, CAP uses a consumer queue with message persistence, but there may be exceptions to this and take part in 2.2.1.</p>
<p>Since Kafka is inherently designed to persist messages using files, Kafka ensures that messages are correctly persisted without loss after the message enters Kafka.</p>
<h3 id="communication-data-streams">Communication Data Streams<a class="headerlink" href="#communication-data-streams" title="Permanent link">&para;</a></h3>
<h2 id="communication-data-streams">Communication Data Streams<a class="headerlink" href="#communication-data-streams" title="Permanent link">&para;</a></h2>
<p>The flow of messages in the CAP is roughly as follows:</p>
<p>&gt;2.2 version before</p>
<p><img alt="" src="http://images2017.cnblogs.com/blog/250417/201708/250417-20170803174645928-1813351415.png" /></p>
......@@ -768,7 +746,7 @@
</blockquote>
<p><strong>After version 2.2</strong></p>
<p>In the 2.2 and later versions, we adjusted the flow of some messages. We removed the Queue table in the database and used the memory queue instead. For details, see: <a href="https://github.com/dotnetcore/CAP/issues/96">Improve the implementation mechanism of queue mode</a></p>
<h3 id="consistency">Consistency<a class="headerlink" href="#consistency" title="Permanent link">&para;</a></h3>
<h2 id="consistency">Consistency<a class="headerlink" href="#consistency" title="Permanent link">&para;</a></h2>
<p>The CAP uses the ultimate consistency as a consistent solution. This solution follows the CAP theory. The following is the description of the CAP theory.</p>
<p>C (consistent) consistency refers to the atomicity of data. It is guaranteed by transactions in a classic database. When a transaction completes, the data will be in a consistent state regardless of success or rollback. In a distributed environment, consistency is Indicates whether the data of multiple nodes is consistent;</p>
<p>A (availability) service is always available, when the user sends a request, the service can return the result within a certain time;</p>
......@@ -810,7 +788,7 @@
</a>
<a href="../implementation-mechanisms/" title="Implementation Mechanisms" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
<a href="../implementation/" title="Implementation Mechanisms" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
<span class="md-flex__ellipsis">
<span class="md-footer-nav__direction">
......
This diff is collapsed.
This diff is collapsed.
......@@ -13,7 +13,7 @@
<meta name="description" content="Project documentation with Markdown.">
<link rel="canonical" href="https://cap.dotnet-chain.org/user-guide/distributed-transactions/">
<link rel="canonical" href="https://cap.dotnet-chain.org/user-guide/transaction/">
<meta name="author" content="CAP Team">
......@@ -108,7 +108,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#asynchronous-recovery-events" tabindex="1" class="md-skip">
<a href="#transaction" tabindex="1" class="md-skip">
Skip to content
</a>
......@@ -381,7 +381,7 @@
<li class="md-nav__item">
<a href="../design-principle/" title="Design Principle" class="md-nav__link">
<a href="../design/" title="Design Principle" class="md-nav__link">
Design Principle
</a>
</li>
......@@ -393,7 +393,7 @@
<li class="md-nav__item">
<a href="../implementation-mechanisms/" title="Implementation Mechanisms" class="md-nav__link">
<a href="../implementation/" title="Implementation Mechanisms" class="md-nav__link">
Implementation Mechanisms
</a>
</li>
......@@ -410,6 +410,8 @@
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
<label class="md-nav__link md-nav__link--active" for="__toc">
Distributed Transactions
......@@ -423,6 +425,8 @@
<nav class="md-nav md-nav--secondary">
<label class="md-nav__title" for="__toc">Table of contents</label>
<ul class="md-nav__list" data-md-scrollfix>
......@@ -644,6 +648,8 @@
<nav class="md-nav md-nav--secondary">
<label class="md-nav__title" for="__toc">Table of contents</label>
<ul class="md-nav__list" data-md-scrollfix>
......@@ -671,13 +677,12 @@
<article class="md-content__inner md-typeset">
<a href="https://github.com/dotnetcore/cap/edit/master/docs/user-guide/distributed-transactions.md" title="Edit this page" class="md-icon md-content__icon">&#xE3C9;</a>
<a href="https://github.com/dotnetcore/cap/edit/master/docs/user-guide/transaction.md" title="Edit this page" class="md-icon md-content__icon">&#xE3C9;</a>
<h1>Distributed Transactions</h1>
<p>For the processing of distributed transactions, this CAP library matches the "Asynchronous recovery events" scenario.</p>
<h3 id="asynchronous-recovery-events">Asynchronous recovery events<a class="headerlink" href="#asynchronous-recovery-events" title="Permanent link">&para;</a></h3>
<h1 id="transaction">Transaction<a class="headerlink" href="#transaction" title="Permanent link">&para;</a></h1>
<p>For the processing of distributed transactions, this CAP library matches the "Asynchronous recovery events" scenario.</p>
<h2 id="asynchronous-recovery-events">Asynchronous recovery events<a class="headerlink" href="#asynchronous-recovery-events" title="Permanent link">&para;</a></h2>
<p>As known as the name "native message table", this is a classic solution, originally from EBay, and referenced links about it are at the end of this section. This is also one of the most popular solutions in the business development. </p>
<p>Compared to TCC or 2pc/3pc, this solution is the simplest one for distributed transactions, and is decentralized. In TCC or 2PC solutions, the common transaction handlers synchronize the state among different services with a transaction coordinator, but it's not much required in this CAP solution. In addition, the deeper references of other conditions these services have, the more management complexity and stability risk may be increased in 2PC/TCC. Imagine that if we have 9 services committed successfully of all 10 whitch relied heavily, though the last one execute fail, should we roll back transactions of those 9 service? In fact, the cost is still very high. </p>
<p>However, it's not mean that 2PC or TCC are at a disadvantage, each has its own suitability and matched scenarios, here won't introduce more.</p>
......@@ -705,7 +710,7 @@
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid">
<a href="../implementation-mechanisms/" title="Implementation Mechanisms" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<a href="../implementation/" title="Implementation Mechanisms" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<div class="md-flex__cell md-flex__cell--shrink">
<i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment