Skip to content

Commit

Permalink
Merge pull request #462 from dotnetcore/dev
Browse files Browse the repository at this point in the history
v1.9.0 release
  • Loading branch information
catcherwong authored Feb 26, 2023
2 parents ce90d95 + 26ddfa7 commit 9776bf4
Show file tree
Hide file tree
Showing 41 changed files with 573 additions and 223 deletions.
30 changes: 13 additions & 17 deletions build/releasenotes.props
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
<Project>
<PropertyGroup>
<EasyCachingCorePackageNotes>
1. Add GetAllKeysByPrefix.
2. Support zremrangebyscore
</EasyCachingCorePackageNotes>
<EasyCachingMemcachedPackageNotes>
1. Upgrading dependencies.
</EasyCachingMemcachedPackageNotes>
<EasyCachingRedisPackageNotes>
1. Upgrading dependencies.
2. Support zremrangebyscore
1. Fixed redis distributed lock for different process.
2. Support code configuration for StackExchange.Redis.
</EasyCachingRedisPackageNotes>
<EasyCachingSQLitePackageNotes>
1. Upgrading dependencies.
</EasyCachingSQLitePackageNotes>
<EasyCachingInMemoryPackageNotes>
1. Upgrading dependencies.
2. Support evicted event hook.
</EasyCachingInMemoryPackageNotes>
<EasyCachingHybridPackageNotes>
1. Upgrading dependencies.
2. Added a HybridCachingOption to throw an error if the distributed cache throws an error.
</EasyCachingHybridPackageNotes>
<EasyCachingAspectCorePackageNotes>
1. Upgrading dependencies.
Expand All @@ -42,27 +38,27 @@
</EasyCachingProtobufPackageNotes>
<EasyCachingCSRedisPackageNotes>
1. Upgrading dependencies.
2. Support zremrangebyscore
</EasyCachingCSRedisPackageNotes>
<EasyCachingCSRedisBusPackageNotes>
1. Upgrading dependencies.
1. Support async version of subscribe.
</EasyCachingCSRedisBusPackageNotes>
<EasyCachingRedisBusPackageNotes>
1. Upgrading dependencies.
1. Support code configuration for StackExchange.Redis.
2. Support async version of subscribe.
</EasyCachingRedisBusPackageNotes>
<EasyCachingRabbitBusPackageNotes>
1. Upgrading dependencies.
2. Use DefaultObjectPoolProvider to get a DisposableObjectPool instead of a DefaultObjectPool
3. Restore queue model and consumer on disconnection
1. Support async version of subscribe.
</EasyCachingRabbitBusPackageNotes>
<EasyCachingKafkaBusPackageNotes>
1. Upgrading dependencies.
1. Support async version of subscribe.
</EasyCachingKafkaBusPackageNotes>
<EasyCachingZookeeperBusPackageNotes>
1. Upgrading dependencies.
1. Support async version of subscribe.
2. Rename WithConfluentKafkaBus to WithZookeeeperBus.
</EasyCachingZookeeperBusPackageNotes>
<EasyCachingDiskPackageNotes>
1. Upgrading dependencies.
1. Support custom serializer.
2. Fixed DiskCachingProvider async warning.
</EasyCachingDiskPackageNotes>
<EasyCachingLiteDBPackageNotes>
1. Upgrading dependencies.
Expand All @@ -71,10 +67,10 @@
1. Upgrading dependencies.
</EasyCachingSTJsonPackageNotes>
<EasyCachingMemoryPackageNotes>
1. Support Memory Pack.
1. Upgrading dependencies.
</EasyCachingMemoryPackageNotes>
<EasyCachingFaskKVPackageNotes>
1. Support FaskKV.
1. Upgrading dependencies.
</EasyCachingFaskKVPackageNotes>
</PropertyGroup>
</Project>
48 changes: 24 additions & 24 deletions build/version.props
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<Project>
<PropertyGroup>
<EasyCachingCorePackageVersion>1.8.0</EasyCachingCorePackageVersion>
<EasyCachingMemcachedPackageVersion>1.8.0</EasyCachingMemcachedPackageVersion>
<EasyCachingRedisPackageVersion>1.8.0</EasyCachingRedisPackageVersion>
<EasyCachingSQLitePackageVersion>1.8.0</EasyCachingSQLitePackageVersion>
<EasyCachingInMemoryPackageVersion>1.8.0</EasyCachingInMemoryPackageVersion>
<EasyCachingHybridPackageVersion>1.8.0</EasyCachingHybridPackageVersion>
<EasyCachingAspectCorePackageVersion>1.8.0</EasyCachingAspectCorePackageVersion>
<EasyCachingCastlePackageVersion>1.8.0</EasyCachingCastlePackageVersion>
<EasyCachingResponseCachingPackageVersion>1.8.0</EasyCachingResponseCachingPackageVersion>
<EasyCachingJsonPackageVersion>1.8.0</EasyCachingJsonPackageVersion>
<EasyCachingMessagePackPackageVersion>1.8.0</EasyCachingMessagePackPackageVersion>
<EasyCachingProtobufPackageVersion>1.8.0</EasyCachingProtobufPackageVersion>
<EasyCachingCSRedisPackageVersion>1.8.0</EasyCachingCSRedisPackageVersion>
<EasyCachingRedisBusPackageVersion>1.8.0</EasyCachingRedisBusPackageVersion>
<EasyCachingCSRedisBusPackageVersion>1.8.0</EasyCachingCSRedisBusPackageVersion>
<EasyCachingRabbitBusPackageVersion>1.8.0</EasyCachingRabbitBusPackageVersion>
<EasyCachingKafkaBusPackageVersion>1.8.0</EasyCachingKafkaBusPackageVersion>
<EasyCachingZookeeperBusPackageVersion>1.8.0</EasyCachingZookeeperBusPackageVersion>
<EasyCachingDiskPackageVersion>1.8.0</EasyCachingDiskPackageVersion>
<EasyCachingMsExtPackageVersion>1.8.0</EasyCachingMsExtPackageVersion>
<EasyCachingLiteDBPackageVersion>1.8.0</EasyCachingLiteDBPackageVersion>
<EasyCachingSTJsonPackageVersion>1.8.0</EasyCachingSTJsonPackageVersion>
<EasyCachingMemoryPackageVersion>1.8.0</EasyCachingMemoryPackageVersion>
<EasyCachingFaskKVPackageVersion>1.8.0</EasyCachingFaskKVPackageVersion>
<EasyCachingCorePackageVersion>1.9.0</EasyCachingCorePackageVersion>
<EasyCachingMemcachedPackageVersion>1.9.0</EasyCachingMemcachedPackageVersion>
<EasyCachingRedisPackageVersion>1.9.0</EasyCachingRedisPackageVersion>
<EasyCachingSQLitePackageVersion>1.9.0</EasyCachingSQLitePackageVersion>
<EasyCachingInMemoryPackageVersion>1.9.0</EasyCachingInMemoryPackageVersion>
<EasyCachingHybridPackageVersion>1.9.0</EasyCachingHybridPackageVersion>
<EasyCachingAspectCorePackageVersion>1.9.0</EasyCachingAspectCorePackageVersion>
<EasyCachingCastlePackageVersion>1.9.0</EasyCachingCastlePackageVersion>
<EasyCachingResponseCachingPackageVersion>1.9.0</EasyCachingResponseCachingPackageVersion>
<EasyCachingJsonPackageVersion>1.9.0</EasyCachingJsonPackageVersion>
<EasyCachingMessagePackPackageVersion>1.9.0</EasyCachingMessagePackPackageVersion>
<EasyCachingProtobufPackageVersion>1.9.0</EasyCachingProtobufPackageVersion>
<EasyCachingCSRedisPackageVersion>1.9.0</EasyCachingCSRedisPackageVersion>
<EasyCachingRedisBusPackageVersion>1.9.0</EasyCachingRedisBusPackageVersion>
<EasyCachingCSRedisBusPackageVersion>1.9.0</EasyCachingCSRedisBusPackageVersion>
<EasyCachingRabbitBusPackageVersion>1.9.0</EasyCachingRabbitBusPackageVersion>
<EasyCachingKafkaBusPackageVersion>1.9.0</EasyCachingKafkaBusPackageVersion>
<EasyCachingZookeeperBusPackageVersion>1.9.0</EasyCachingZookeeperBusPackageVersion>
<EasyCachingDiskPackageVersion>1.9.0</EasyCachingDiskPackageVersion>
<EasyCachingMsExtPackageVersion>1.9.0</EasyCachingMsExtPackageVersion>
<EasyCachingLiteDBPackageVersion>1.9.0</EasyCachingLiteDBPackageVersion>
<EasyCachingSTJsonPackageVersion>1.9.0</EasyCachingSTJsonPackageVersion>
<EasyCachingMemoryPackageVersion>1.9.0</EasyCachingMemoryPackageVersion>
<EasyCachingFaskKVPackageVersion>1.9.0</EasyCachingFaskKVPackageVersion>
</PropertyGroup>
</Project>
15 changes: 15 additions & 0 deletions bus/EasyCaching.Bus.CSRedis/DefaultCSRedisBus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,21 @@ public override void BaseSubscribe(string topic, Action<EasyCachingMessage> acti
);
}

/// <summary>
/// Subscribe the specified topic and action async.
/// </summary>
/// <param name="topic">Topic.</param>
/// <param name="action">Action.</param>
/// <param name="cancellationToken">Cancellation token.</param>
public override Task BaseSubscribeAsync(string topic, Action<EasyCachingMessage> action, CancellationToken cancellationToken = default(CancellationToken))
{
_client.Subscribe(
(topic, msg => OnMessage(msg.Body))
);
return Task.CompletedTask;
}


/// <summary>
/// Ons the message.
/// </summary>
Expand Down
26 changes: 23 additions & 3 deletions bus/EasyCaching.Bus.ConfluentKafka/DefaultConfluentKafkaBus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using Microsoft.Extensions.Options;

public class DefaultConfluentKafkaBus : EasyCachingAbstractBus
{
{


/// <summary>
Expand Down Expand Up @@ -77,7 +77,7 @@ public override void BasePublish(string topic, EasyCachingMessage message)
/// <param name="cancellationToken">Cancellation token.</param>
public override async Task BasePublishAsync(string topic, EasyCachingMessage message, CancellationToken cancellationToken = default(CancellationToken))
{
var msg = _serializer.Serialize(message);
var msg = _serializer.Serialize(message);

await _producer.ProduceAsync(topic, new Message<Null, byte[]> { Value = msg });
}
Expand All @@ -89,7 +89,27 @@ public override void BasePublish(string topic, EasyCachingMessage message)
/// <param name="action">Action.</param>
public override void BaseSubscribe(string topic, Action<EasyCachingMessage> action)
{
Task.Factory.StartNew(() =>
_ = StartConsumer(topic);
}

/// <summary>
/// Subscribe the specified topic and action async.
/// </summary>
/// <param name="topic">Topic.</param>
/// <param name="action">Action.</param>
/// <param name="cancellationToken">Cancellation token.</param>
public override async Task BaseSubscribeAsync(string topic, Action<EasyCachingMessage> action, CancellationToken cancellationToken = default(CancellationToken))
{
await StartConsumer(topic);
}

/// <summary>
/// Ons the consumer.
/// </summary>
/// <param name="topic">Topic</param>
private Task StartConsumer(string topic)
{
return Task.Factory.StartNew(() =>
{
for (int i = 0; i < this._kafkaBusOptions.ConsumerCount; i++)
{
Expand Down
24 changes: 23 additions & 1 deletion bus/EasyCaching.Bus.RabbitMQ/DefaultRabbitMQBus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ IPooledObjectPolicy<IModel> _objectPolicy
RequestedConnectionTimeout = System.TimeSpan.FromMilliseconds(_options.RequestedConnectionTimeout),
SocketReadTimeout = System.TimeSpan.FromMilliseconds(_options.SocketReadTimeout),
SocketWriteTimeout = System.TimeSpan.FromMilliseconds(_options.SocketWriteTimeout),
ClientProvidedName = _options.ClientProvidedName
ClientProvidedName = _options.ClientProvidedName,
};

_subConnection = factory.CreateConnection();
Expand Down Expand Up @@ -156,6 +156,28 @@ public override void BaseSubscribe(string topic, Action<EasyCachingMessage> acti
}


/// <summary>
/// Subscribe the specified topic and action async.
/// </summary>
/// <param name="topic">Topic.</param>
/// <param name="action">Action.</param>
/// <param name="cancellationToken">Cancellation token.</param>
public override Task BaseSubscribeAsync(string topic, Action<EasyCachingMessage> action, CancellationToken cancellationToken = default(CancellationToken))
{
var queueName = string.Empty;
if (string.IsNullOrWhiteSpace(_options.QueueName))
{
queueName = $"rmq.queue.undurable.easycaching.subscriber.{_busId}";
}
else
{
queueName = _options.QueueName;
}

StartConsumer(queueName, topic);
return Task.CompletedTask;
}

private void StartConsumer(string queueName, string topic)
{
var model = _subConnection.CreateModel();
Expand Down
6 changes: 6 additions & 0 deletions bus/EasyCaching.Bus.Redis/Configurations/RedisBusOptions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace EasyCaching.Bus.Redis
{
using EasyCaching.Core.Configurations;
using StackExchange.Redis;

/// <summary>
/// Redis bus options.
Expand All @@ -17,5 +18,10 @@ public class RedisBusOptions : BaseRedisOptions
/// Gets or sets the serializer name that should be use in this bus.
/// </summary>
public string SerializerName { get; set; }

/// <summary>
/// Gets or sets the Redis database ConfigurationOptions will use.
/// </summary>
public ConfigurationOptions ConfigurationOptions { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ public ISubscriber GetSubscriber()
/// <returns>The connection multiplexer.</returns>
private ConnectionMultiplexer CreateConnectionMultiplexer()
{
if (_options.ConfigurationOptions != null)
return ConnectionMultiplexer.Connect(_options.ConfigurationOptions);

if (string.IsNullOrWhiteSpace(_options.Configuration))
{
var configurationOptions = new ConfigurationOptions
Expand All @@ -67,7 +70,7 @@ private ConnectionMultiplexer CreateConnectionMultiplexer()
configurationOptions.EndPoints.Add(endpoint.Host, endpoint.Port);
}

return ConnectionMultiplexer.Connect(configurationOptions.ToString());
return ConnectionMultiplexer.Connect(configurationOptions);
}
else
{
Expand Down
11 changes: 11 additions & 0 deletions bus/EasyCaching.Bus.Redis/DefaultRedisBus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,16 @@ public override void BaseSubscribe(string topic, Action<EasyCachingMessage> acti
{
_subscriber.Subscribe(topic, OnMessage);
}

/// <summary>
/// Subscribe the specified topic and action async.
/// </summary>
/// <param name="topic">Topic.</param>
/// <param name="action">Action.</param>
/// <param name="cancellationToken">Cancellation token.</param>
public override async Task BaseSubscribeAsync(string topic, Action<EasyCachingMessage> action, CancellationToken cancellationToken = default(CancellationToken))
{
await _subscriber.SubscribeAsync(topic, OnMessage);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ this EasyCachingOptions options
/// <param name="configuration"></param>
/// <param name="sectionName">The section name in the configuration file.</param>
/// <returns></returns>
public static EasyCachingOptions WithConfluentKafkaBus(
public static EasyCachingOptions WithZookeeeperBus(
this EasyCachingOptions options
, IConfiguration configuration
, string sectionName = EasyCachingConstValue.ZookeeperBusSection
Expand Down
12 changes: 12 additions & 0 deletions bus/EasyCaching.Bus.Zookeeper/DefaultZookeeperBus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,18 @@ public override void BaseSubscribe(string topic, Action<EasyCachingMessage> acti
}, TaskCreationOptions.LongRunning);
}

/// <summary>
/// Subscribe the specified topic and action async.
/// </summary>
/// <param name="topic">Topic.</param>
/// <param name="action">Action.</param>
/// <param name="cancellationToken">Cancellation token.</param>
public override async Task BaseSubscribeAsync(string topic, Action<EasyCachingMessage> action, CancellationToken cancellationToken = default(CancellationToken))
{
var path = $"{topic}";
await SubscribeDataChangeAsync(path, SubscribeDataChange);
}

/// <summary>
/// Ons the message.
/// </summary>
Expand Down
3 changes: 3 additions & 0 deletions docs/BinaryFormatter.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ Because [EnyimMemcachedCore](https://github.com/cnblogs/EnyimMemcachedCore) use

Also, EnyimMemcachedCore implements BinaryFormatterTranscoder based on BinaryFormatter.

Important NOTE:

BinaryFormatter was removed by EasyCaching v1.7.0, due to after version .net 5 , it will no longer support.
Loading

0 comments on commit 9776bf4

Please sign in to comment.