-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #503 from dotnetcore/dev
v1.9.2 release
- Loading branch information
Showing
26 changed files
with
740 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,29 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<EasyCachingCorePackageVersion>1.9.1</EasyCachingCorePackageVersion> | ||
<EasyCachingMemcachedPackageVersion>1.9.1</EasyCachingMemcachedPackageVersion> | ||
<EasyCachingRedisPackageVersion>1.9.1</EasyCachingRedisPackageVersion> | ||
<EasyCachingSQLitePackageVersion>1.9.1</EasyCachingSQLitePackageVersion> | ||
<EasyCachingInMemoryPackageVersion>1.9.1</EasyCachingInMemoryPackageVersion> | ||
<EasyCachingHybridPackageVersion>1.9.1</EasyCachingHybridPackageVersion> | ||
<EasyCachingAspectCorePackageVersion>1.9.1</EasyCachingAspectCorePackageVersion> | ||
<EasyCachingCastlePackageVersion>1.9.1</EasyCachingCastlePackageVersion> | ||
<EasyCachingResponseCachingPackageVersion>1.9.1</EasyCachingResponseCachingPackageVersion> | ||
<EasyCachingJsonPackageVersion>1.9.1</EasyCachingJsonPackageVersion> | ||
<EasyCachingMessagePackPackageVersion>1.9.1</EasyCachingMessagePackPackageVersion> | ||
<EasyCachingProtobufPackageVersion>1.9.1</EasyCachingProtobufPackageVersion> | ||
<EasyCachingCSRedisPackageVersion>1.9.1</EasyCachingCSRedisPackageVersion> | ||
<EasyCachingRedisBusPackageVersion>1.9.1</EasyCachingRedisBusPackageVersion> | ||
<EasyCachingCSRedisBusPackageVersion>1.9.1</EasyCachingCSRedisBusPackageVersion> | ||
<EasyCachingRabbitBusPackageVersion>1.9.1</EasyCachingRabbitBusPackageVersion> | ||
<EasyCachingKafkaBusPackageVersion>1.9.1</EasyCachingKafkaBusPackageVersion> | ||
<EasyCachingZookeeperBusPackageVersion>1.9.1</EasyCachingZookeeperBusPackageVersion> | ||
<EasyCachingDiskPackageVersion>1.9.1</EasyCachingDiskPackageVersion> | ||
<EasyCachingMsExtPackageVersion>1.9.1</EasyCachingMsExtPackageVersion> | ||
<EasyCachingLiteDBPackageVersion>1.9.1</EasyCachingLiteDBPackageVersion> | ||
<EasyCachingSTJsonPackageVersion>1.9.1</EasyCachingSTJsonPackageVersion> | ||
<EasyCachingMemoryPackageVersion>1.9.1</EasyCachingMemoryPackageVersion> | ||
<EasyCachingFaskKVPackageVersion>1.9.1</EasyCachingFaskKVPackageVersion> | ||
<EasyCachingCorePackageVersion>1.9.2</EasyCachingCorePackageVersion> | ||
<EasyCachingMemcachedPackageVersion>1.9.2</EasyCachingMemcachedPackageVersion> | ||
<EasyCachingRedisPackageVersion>1.9.2</EasyCachingRedisPackageVersion> | ||
<EasyCachingSQLitePackageVersion>1.9.2</EasyCachingSQLitePackageVersion> | ||
<EasyCachingInMemoryPackageVersion>1.9.2</EasyCachingInMemoryPackageVersion> | ||
<EasyCachingHybridPackageVersion>1.9.2</EasyCachingHybridPackageVersion> | ||
<EasyCachingAspectCorePackageVersion>1.9.2</EasyCachingAspectCorePackageVersion> | ||
<EasyCachingCastlePackageVersion>1.9.2</EasyCachingCastlePackageVersion> | ||
<EasyCachingResponseCachingPackageVersion>1.9.2</EasyCachingResponseCachingPackageVersion> | ||
<EasyCachingJsonPackageVersion>1.9.2</EasyCachingJsonPackageVersion> | ||
<EasyCachingMessagePackPackageVersion>1.9.2</EasyCachingMessagePackPackageVersion> | ||
<EasyCachingProtobufPackageVersion>1.9.2</EasyCachingProtobufPackageVersion> | ||
<EasyCachingCSRedisPackageVersion>1.9.2</EasyCachingCSRedisPackageVersion> | ||
<EasyCachingRedisBusPackageVersion>1.9.2</EasyCachingRedisBusPackageVersion> | ||
<EasyCachingCSRedisBusPackageVersion>1.9.2</EasyCachingCSRedisBusPackageVersion> | ||
<EasyCachingRabbitBusPackageVersion>1.9.2</EasyCachingRabbitBusPackageVersion> | ||
<EasyCachingRabbitStreamBusPackageVersion>1.9.2</EasyCachingRabbitStreamBusPackageVersion> | ||
<EasyCachingKafkaBusPackageVersion>1.9.2</EasyCachingKafkaBusPackageVersion> | ||
<EasyCachingZookeeperBusPackageVersion>1.9.2</EasyCachingZookeeperBusPackageVersion> | ||
<EasyCachingDiskPackageVersion>1.9.2</EasyCachingDiskPackageVersion> | ||
<EasyCachingMsExtPackageVersion>1.9.2</EasyCachingMsExtPackageVersion> | ||
<EasyCachingLiteDBPackageVersion>1.9.2</EasyCachingLiteDBPackageVersion> | ||
<EasyCachingSTJsonPackageVersion>1.9.2</EasyCachingSTJsonPackageVersion> | ||
<EasyCachingMemoryPackageVersion>1.9.2</EasyCachingMemoryPackageVersion> | ||
<EasyCachingFaskKVPackageVersion>1.9.2</EasyCachingFaskKVPackageVersion> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
bus/EasyCaching.Bus.RabbitMQStream/Configurations/EasyCachingOptionsExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
namespace Microsoft.Extensions.DependencyInjection | ||
{ | ||
using System; | ||
using EasyCaching.Bus.RabbitMQ; | ||
using EasyCaching.Bus.RabbitMQStream; | ||
using EasyCaching.Core; | ||
using EasyCaching.Core.Configurations; | ||
using Microsoft.Extensions.Configuration; | ||
|
||
/// <summary> | ||
/// EasyCaching options extensions. | ||
/// </summary> | ||
public static class EasyCachingOptionsExtensions | ||
{ | ||
/// <summary> | ||
/// Withs the RabbitMQStream bus (specify the config via hard code). | ||
/// </summary> | ||
/// <param name="options">Options.</param> | ||
/// <param name="configure">Configure bus settings.</param> | ||
|
||
public static EasyCachingOptions WithRabbitMQStreamBus( | ||
this EasyCachingOptions options | ||
, Action<RabbitMQBusOptions> configure | ||
) | ||
{ | ||
ArgumentCheck.NotNull(configure, nameof(configure)); | ||
|
||
options.RegisterExtension(new RabbitMQStreamBusOptionsExtension(configure)); | ||
return options; | ||
} | ||
|
||
/// <summary> | ||
/// Withs the RabbitMQStream bus (read config from configuration file). | ||
/// </summary> | ||
/// <param name="options">Options.</param> | ||
/// <param name="configuration">The configuration.</param> | ||
/// <param name="sectionName">The section name in the configuration file.</param> | ||
public static EasyCachingOptions WithRabbitMQStreamBus( | ||
this EasyCachingOptions options | ||
, IConfiguration configuration | ||
, string sectionName = EasyCachingConstValue.RabbitMQBusSection | ||
) | ||
{ | ||
var dbConfig = configuration.GetSection(sectionName); | ||
var busOptions = new RabbitMQBusOptions(); | ||
dbConfig.Bind(busOptions); | ||
|
||
void configure(RabbitMQBusOptions x) | ||
{ | ||
x.HostName = busOptions.HostName; | ||
x.Password = busOptions.Password; | ||
x.Port = busOptions.Port; | ||
x.QueueMessageExpires = busOptions.QueueMessageExpires; | ||
x.RequestedConnectionTimeout = busOptions.RequestedConnectionTimeout; | ||
//x.RouteKey = busOptions.RouteKey; | ||
x.SocketReadTimeout = busOptions.SocketReadTimeout; | ||
x.SocketWriteTimeout = busOptions.SocketWriteTimeout; | ||
x.TopicExchangeName = busOptions.TopicExchangeName; | ||
x.UserName = busOptions.UserName; | ||
x.VirtualHost = busOptions.VirtualHost; | ||
x.QueueName = busOptions.QueueName; | ||
} | ||
|
||
options.RegisterExtension(new RabbitMQStreamBusOptionsExtension(configure)); | ||
return options; | ||
} | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
bus/EasyCaching.Bus.RabbitMQStream/Configurations/RabbitMQStreamBusOptionsExtension.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
namespace EasyCaching.Bus.RabbitMQStream | ||
{ | ||
using System; | ||
using EasyCaching.Bus.RabbitMQ; | ||
using EasyCaching.Core.Bus; | ||
using EasyCaching.Core.Configurations; | ||
using global::RabbitMQ.Client; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.ObjectPool; | ||
|
||
/// <summary> | ||
/// RabbitMQ Bus options extension. | ||
/// </summary> | ||
public class RabbitMQStreamBusOptionsExtension : IEasyCachingOptionsExtension | ||
{ | ||
/// <summary> | ||
/// The configure. | ||
/// </summary> | ||
private readonly Action<RabbitMQBusOptions> configure; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="T:EasyCaching.Bus.RabbitMQ.RabbitMQBusOptionsExtension"/> class. | ||
/// </summary> | ||
/// <param name="configure">Configure.</param> | ||
public RabbitMQStreamBusOptionsExtension(Action<RabbitMQBusOptions> configure) | ||
{ | ||
this.configure = configure; | ||
} | ||
|
||
/// <summary> | ||
/// Adds the services. | ||
/// </summary> | ||
/// <param name="services">Services.</param> | ||
public void AddServices(IServiceCollection services) | ||
{ | ||
services.AddOptions(); | ||
services.Configure(configure); | ||
|
||
services.AddSingleton<IPooledObjectPolicy<IModel>, ModelPooledObjectPolicy>(); | ||
services.AddSingleton<IEasyCachingBus, DefaultRabbitMQStreamBus>(); | ||
} | ||
} | ||
} |
Oops, something went wrong.