Added redis distributed lock info the the 5.0-beta.1 blog post.

pull/10308/head
Halil İbrahim Kalkan 4 years ago
parent 8abb53db42
commit 3eb09c8455

@ -119,7 +119,7 @@ Enabling the inbox and outbox patterns requires a few manual steps for your appl
First of all, you need to have EF Core or MongoDB installed into your solution. It should be already installed if you'd created a solution from the ABP startup template.
#### Install the package
#### Install the packages
Install the new [Volo.Abp.EventBus.Boxes](https://www.nuget.org/packages/Volo.Abp.EventBus.Boxes) NuGet package to your database layer (to `EntityFrameworkCore` or `MongoDB` project) or to the host application. Open a command-line terminal at the root directory of your database (or host) project and execute the following command:
@ -127,7 +127,27 @@ Install the new [Volo.Abp.EventBus.Boxes](https://www.nuget.org/packages/Volo.Ab
abp add-package Volo.Abp.EventBus.Boxes
````
This will install the package and setup the ABP module dependency.
This will install the package and setup the ABP module dependency. This package depends on [DistributedLock.Core](https://www.nuget.org/packages/DistributedLock.Core) library which provides a distributed locking system for concurrency control in a distributed environment. There are [many distributed lock providers](https://github.com/madelson/DistributedLock#implementations), including Redis, SqlServer and ZooKeeper. You can use the one you like. Here, I will show the Redis provider.
Add [DistributedLock.Redis](https://www.nuget.org/packages/DistributedLock.Redis) NuGet package to your project, then add the following code into the ConfigureService method of your ABP module class:
````csharp
context.Services.AddSingleton<IDistributedLockProvider>(sp =>
{
var connection = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);
return new RedisDistributedSynchronizationProvider(connection.GetDatabase());
});
````
We are getting the Redis configuration from the `appsettings.json` file, so add the following lines to your `appsettings.json` file:
````json
"Redis": {
"Configuration": "127.0.0.1"
}
````
You can change the IP or customize the configuration based on your environment.
#### Configure the DbContext

Loading…
Cancel
Save