Preface

today , We are pleased to announce CAP Release 6.1 Version official , In this version, we mainly focus on the several BUG Fixed and added some small features .

that , Next, let's take a specific look .

The overview

Maybe some of you don't know CAP What is it? , A brief introduction to the old ways .

CAP Is an open source project solution to solve the problem of distributed transactions in microservices or distributed systems (https://github.com/dotnetcore/CAP) It can also be used as EventBus Use , The project was born in 2016 year , Currently in Github There has been more than 5500+ Star and 70+ contributor , And in NuGet super 250 10000 Downloads , And it has been applied in the and projects of more and more companies .

If you want to be right CAP Learn more about , Please check our Official documents .

This time at CAP 6.1 In this version, we mainly bring the following new features :

  • Optimized snowflake algorithm
  • Dashboard Support customization Authorization Policy
  • Azure Service Bus Add support for deferred messages
  • Support to configure the expiration and deletion time of failure messages
  • BUG Repair
    • Repair Dashbaord Enable Challenge Verification sequence problem
    • Repair RabbitMQ When the network jitters, the health check error occurs occasionally
    • Repair MySQL 8.0 When retrying query SQL Date format error
    • Repair Redis Streams Problems with idempotence checking when reading or creating streams

Optimized snowflake algorithm

In the past, we used the standard snowflake algorithm , There will be a clock sensitive problem .

because ID The generation is always bound to the timestamp of the current operating system ( It makes use of the monotonicity of time )), So if the clock of the operating system goes back , Generated ID Will repeat , Generally, people will not manually dial back the clock , But the server will have occasional " Clock drift " The phenomenon . That is to say, in the case of multi node deployment , If the time of some servers is not accurate, duplicate keys will be generated and errors will be reported when writing messages to the database .

In this version , Unbind the time from the operating system timestamp , The generator only gets the current timestamp of the system at initialization , As the initial timestamp , But then it is no longer synchronized with the system timestamp . The increment after it , It is only driven by the increment of serial number . For example, the current value of the serial number is 4095, Next request to come in , Serial number +1 overflow 12 Bitspace , The serial number is reset to zero , The overflow carry is added to the timestamp , So that the timestamp +1.

After this version is updated , Generated Id There may be a large difference from the previous version , Just pay attention , It doesn't matter .

thank @Allen-dududu Submitted for PR!

Dashboard Support customization Authorization Policy

In this version , our Dashboard A new configuration item named AuthorizationPolicy Configuration item for , Used in scenarios where you want to use, for example, role-based authorization verification in the authorization process .

Usage is as follows , Mainly the annotated part .

services.AddAuthorization((options =>
{
// only if you want to apply role filter to CAP Dashboard user
options.AddPolicy("PolicyCap", policy => policy.RequireRole("admin.events"));
}))
.AddAuthentication(options =>
{
options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
})
.AddCookie()
.AddOpenIdConnect(options =>
{
options.Authority = "https://demo.identityserver.io/";
options.ClientId = "interactive.confidential";
options.ClientSecret = "secret";
options.ResponseType = "code";
options.UsePkce = true; options.Scope.Clear();
options.Scope.Add("openid");
options.Scope.Add("profile");
}); services.AddCap(cap =>
{
cap.UseDashboard(d =>
{
d.UseChallengeOnAuth = true;
d.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
d.UseAuth = true;
// only if you want to apply policy authorization filter to CAP Dashboard user
d.AuthorizationPolicy = "PolicyCap";
});
// ***
}

thank @albertopm19 Submitted for PR!

Azure Service Bus Add support for deferred messages

stay Azure Service Bus Zhongyuan provides support for delayed message sending , That is to use its ScheduledEnqueueTimeUtc Property settings . In this version, the CAP Specify the header message during sending to take advantage of this feature .

Examples are as follows :

[HttpPost("publish")]
public async Task Publish()
{
await _publisher.PublishAsync("demo-publish", string.Empty, new Dictionary<string, string?>
{
[AzureServiceBusHeaders.ScheduledEnqueueTimeUtc] = DateTimeOffset.UtcNow.AddSeconds(60).ToString(),
});
}

thank @webinex Submitted for PR!

By the way , Some students also mentioned that RabbitMQ Support for deferred messages in , We do not support it , First, it needs to configure plug-ins to be non-native , Second, I hope you can use the scheduler (Quartz,Hangfire) Wait to do this , Professional things are left to professional components .

Support to configure the expiration and deletion time of failure messages

We have added a new configuration item FailedMessageExpiredAfter Used to configure the expiration time of failed messages , After the expiration time , The message will be deleted . The previous one is the value written dead 15 God , Now you can use this configuration item to configure .

thank @dima-zhemkov Submitted for PR!

BUG Repair

In this version , We have made some discoveries BUG Repair , Here are the repaired content items .

  • Repair Dashbaord Enable Challenge Verification sequence problem .
  • Repair RabbitMQ When the network jitters, the health check error occurs occasionally .
  • Repair MySQL 8.0 When retrying query SQL Date format error
  • Repair Redis Streams Problems with idempotence checking when reading or creating streams

summary

above , It is the support and changes we have made in this version , Thank you for your support , We're happy to be able to help . I hope you can give me positive feedback when you encounter problems in the process of using it , help CAP Get better and better .

If you like the project , You can click Star Give us support .

If you think this article is helpful to you , Thank you for 【 recommend 】.


This paper addresses :http://www.cnblogs.com/savorboard/p/cap-6-1.html

The author blog :Savorboard

The original authorization of this article is : A signature - Noncommercial use - No derivatives , agreement Plain text | agreement Legal text

CAP 6.1 More articles about the release announcement

  1. CAP 2.6 Version release notice

    Preface today , We are pleased to announce CAP Release 2.6 Version official . At the same time, we are happy to tell you CAP stay GitHub It has broken through 3000 Star. Since the last CAP 2.5 Version release since , A few days have passed ...

  2. CAP 3.0 Version release notice

    Preface Hello everyone , We are pleased to announce CAP Released 3.0 Version official . Since the last CAP 2.6 Version release since , Months have passed , Concerned friends may know , In these months , There are also several preview versions of 3. ...

  3. CAP 3.1 Version release notice

    Preface today , We are pleased to announce CAP Release 3.1 Version official . At the same time, we are happy to tell you CAP stay GitHub It has broken through 4000 Star. CAP 3000 Star Or last year 8 Month of the month , most ...

  4. CAP 5.0 Version release notice

    Preface today , We are pleased to announce CAP Release 5.0 Version official . At the same time, we are happy to tell you CAP There are more and more users and become more and more popular . stay 5.0 In the version , We are mainly committed to better support .NET 5 With ...

  5. CAP 5.1 Version release notice - What you are looking forward to Redis coming

    Preface today , We are pleased to announce CAP Release 5.1 Version official , In this release, we also introduced more exciting new features and improvements , At the same time, it is also loved by more and more people . Thanks to the feedback from the community and the support of contributors , In the past two months , We ...

  6. CAP 5.2 Version release notice

    Preface today , We are pleased to announce CAP Release 5.2 Version official , In this version , We are mainly committed to better optimizing the use experience and supporting new Transport, At the same time, some changes have been made in this version bug Repair work . since 5. ...

  7. CAP 6.0 Version release notice - Support OpenTelemetry

    Preface today , We are pleased to announce CAP Release 6.0 Version official , In this version , We are mainly committed to OpenTelemetry Provide support , And better adaptation .NET 6. that , Next, let's take a specific look . The overview ...

  8. CAP 2.4 Version release , Support version isolation feature

    Preface Since the last CAP 2.3 Version release since , Months have passed , It's been a busy few months , So I didn't blog much , Taking the advantage of 2019 At the turn of the year ( It should be 2019 At the beginning of the year ),CAP Also released 2018 The last day of the year ...

  9. CAP 2.3 Version release , Support MongoDB

    Preface after 2 Months of adjustment and testing ,CAP 2.3 The version has finally been released , The biggest feature of this version is for MongoDB Support for , Thanks to the blog Park team keke Students are interested in MongoDB Support the PR, I believe that with the development of blog Park ...

  10. [ Daily pit filling series ]CAP Food Guide - Version reference problem

    One . Preface lately , Because I haven't upgraded the underlying framework for a long time , All the time netcore2.2 edition , As a result, some packages have not been updated to the latest version , for example :CAP. However , Recently upgraded to CAP:3.1.2 At version time , It's a little bit of a pit , Can only return to CAP ...

Random recommendation

  1. Eclipse Related issues

    How to modify Eclipse Of workspace Catalog Eclipse It's a very strong Java IDE, We started with , Often set the default workspace, When used for a long time , We may have to change it workspace ...

  2. zabbix Monitoring system client installation

    original text :http://blog.chinaunix.net/uid-25266990-id-3387002.html Test use agentd Listen for data . The server installation can be viewed http://blog.ch ...

  3. turn :db2 backup And restore

    db2 backup  And restore 2011-06-21 18:12:20|   classification : AIX | report  | Font size   subscribe     Two questions : db2=>list applications db ...

  4. [oracle] solve X64 operating system PL/SQL Connection error problem make sure you have the 32 bits oracle client installed

    Windows 64 The bottom of the seat Oracle 11g 64 position ,PLSQL Developer There are the following problems with using : 1.Database The drop-down box is empty : 2. Force user name . Password and Database, Login pop up : In ...

  5. api Interface

    Catalog (?)[-] Summary of interface features PHP Token token Let's start with the first one tokenapi_token Server interface verification PHP The implementation process is as follows And the second one tokenuser_token The interface use cases are as follows Summary of interface features : ...

  6. Android Development 10.1:UI Component adapter AdapterView( establish ListView,Adapter Interface )

    @version:Android4.3 API18 @author:liuxinming summary               AdapterView Inherited ViewGroup, Its essence is the container       ...

  7. How to use Reaver Crack Wi-Fi Online WPA password

    via: http://lifehacker.com/5873407/how-to-crack-a-wi+fi-networks-wpa-password-with-reaver translator :Mr Small eyes Ben ...

  8. android Compile call C Code

    Blog address :www.zalezone.cn Preface Source of demand Help others to do a simple androidclient, It doesn't work , The main thing is to call C Code to the mobile phone Wifi Network settings . So it leads to the technical difficulties ...

  9. Page caching OutputCache

    Update page cache OutputCache   Why use OutputCache In my submission OutputCache It's the simplest caching technology , It's for page level , A simple instruction can achieve the effect of caching , Effectively lighten the server ...

  10. The 14th smart car training PLL PLL

    What is a phase locked loop ? PLL(Phase Locked Loop): It is a phase-locked loop or phase-locked loop , Used to unify and integrate clock signals , Make the high-frequency device work properly , Such as memory access data, etc .PLL Feedback technology used in oscillator . Many electronic devices have to work properly ...