Skip to content

Commit

Permalink
Merge pull request #440 from dotnetcore/dev
Browse files Browse the repository at this point in the history
release v1.8.0
  • Loading branch information
catcherwong authored Jan 1, 2023
2 parents 174a00a + 9319b1b commit ce90d95
Show file tree
Hide file tree
Showing 68 changed files with 2,407 additions and 241 deletions.
16 changes: 15 additions & 1 deletion EasyCaching.sln
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.2.32616.157
MinimumVisualStudioVersion = 10.0.40219.1
Expand Down Expand Up @@ -74,6 +74,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyCaching.Bus.ConfluentKa
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyCaching.Bus.Zookeeper", "bus\EasyCaching.Bus.Zookeeper\EasyCaching.Bus.Zookeeper.csproj", "{5E488583-391E-4E15-83C1-7301B4FE79AE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyCaching.FasterKv", "src\EasyCaching.FasterKv\EasyCaching.FasterKv.csproj", "{7191E567-38DF-4879-82E1-73EC618AFCAC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyCaching.Serialization.MemoryPack", "serialization\EasyCaching.Serialization.MemoryPack\EasyCaching.Serialization.MemoryPack.csproj", "{EEF22C21-F380-4980-B72C-F14488369333}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -196,6 +200,14 @@ Global
{5E488583-391E-4E15-83C1-7301B4FE79AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5E488583-391E-4E15-83C1-7301B4FE79AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5E488583-391E-4E15-83C1-7301B4FE79AE}.Release|Any CPU.Build.0 = Release|Any CPU
{7191E567-38DF-4879-82E1-73EC618AFCAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7191E567-38DF-4879-82E1-73EC618AFCAC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7191E567-38DF-4879-82E1-73EC618AFCAC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7191E567-38DF-4879-82E1-73EC618AFCAC}.Release|Any CPU.Build.0 = Release|Any CPU
{EEF22C21-F380-4980-B72C-F14488369333}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EEF22C21-F380-4980-B72C-F14488369333}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EEF22C21-F380-4980-B72C-F14488369333}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EEF22C21-F380-4980-B72C-F14488369333}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -230,6 +242,8 @@ Global
{4FCF16BF-5E21-4B74-AB45-3C121ADF1485} = {15070C49-A507-4844-BCFE-D319CFBC9A63}
{F7FBADEB-D766-4595-949A-07104B52692C} = {B337509B-75F9-4851-821F-9BBE87C4E4BC}
{5E488583-391E-4E15-83C1-7301B4FE79AE} = {B337509B-75F9-4851-821F-9BBE87C4E4BC}
{7191E567-38DF-4879-82E1-73EC618AFCAC} = {A0F5CC7E-155F-4726-8DEB-E966950B3FE9}
{EEF22C21-F380-4980-B72C-F14488369333} = {15070C49-A507-4844-BCFE-D319CFBC9A63}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {63A57886-054B-476C-AAE1-8D7C8917682E}
Expand Down
152 changes: 78 additions & 74 deletions build/releasenotes.props
Original file line number Diff line number Diff line change
@@ -1,76 +1,80 @@
<Project>
<PropertyGroup>
<EasyCachingCorePackageNotes>
1. Remove BinaryFormatter.
2. Support removing cache keys by pattern.
</EasyCachingCorePackageNotes>
<EasyCachingMemcachedPackageNotes>
1. Upgrading dependencies.
</EasyCachingMemcachedPackageNotes>
<EasyCachingRedisPackageNotes>
1. Upgrading dependencies.
2. Support removing cache keys by pattern.
</EasyCachingRedisPackageNotes>
<EasyCachingSQLitePackageNotes>
1. Upgrading dependencies.
2. Support removing cache keys by pattern.
</EasyCachingSQLitePackageNotes>
<EasyCachingInMemoryPackageNotes>
1. Upgrading dependencies.
2. Support removing cache keys by pattern.
</EasyCachingInMemoryPackageNotes>
<EasyCachingHybridPackageNotes>
1. Upgrading dependencies.
2. Support removing cache keys by pattern.
</EasyCachingHybridPackageNotes>
<EasyCachingAspectCorePackageNotes>
1. Upgrading dependencies.
</EasyCachingAspectCorePackageNotes>
<EasyCachingCastlePackageNotes>
1. Upgrading dependencies.
</EasyCachingCastlePackageNotes>
<EasyCachingResponseCachingPackageNotes>
1. Upgrading dependencies.
</EasyCachingResponseCachingPackageNotes>
<EasyCachingJsonPackageNotes>
1. Upgrading dependencies.
</EasyCachingJsonPackageNotes>
<EasyCachingMessagePackPackageNotes>
1. Upgrading dependencies.
</EasyCachingMessagePackPackageNotes>
<EasyCachingProtobufPackageNotes>
1. Upgrading dependencies.
</EasyCachingProtobufPackageNotes>
<EasyCachingCSRedisPackageNotes>
1. Upgrading dependencies.
2. Support removing cache keys by pattern.
</EasyCachingCSRedisPackageNotes>
<EasyCachingCSRedisBusPackageNotes>
1. Upgrading dependencies.
2. Support removing cache keys by pattern.
</EasyCachingCSRedisBusPackageNotes>
<EasyCachingRedisBusPackageNotes>
1. Upgrading dependencies.
</EasyCachingRedisBusPackageNotes>
<EasyCachingRabbitBusPackageNotes>
1. Upgrading dependencies.
</EasyCachingRabbitBusPackageNotes>
<EasyCachingKafkaBusPackageNotes>
1. Add EasyCachingKafkaBus.
</EasyCachingKafkaBusPackageNotes>
<EasyCachingZookeeperBusPackageNotes>
1. Add EasyCachingZookeeperBus.
</EasyCachingZookeeperBusPackageNotes>
<EasyCachingDiskPackageNotes>
1. Upgrading dependencies.
2. Support removing cache keys by pattern.
</EasyCachingDiskPackageNotes>
<EasyCachingLiteDBPackageNotes>
1. Upgrading dependencies.
2. Support removing cache keys by pattern.
</EasyCachingLiteDBPackageNotes>
<EasyCachingSTJsonPackageNotes>
1. Upgrading dependencies.
</EasyCachingSTJsonPackageNotes>
</PropertyGroup>
<PropertyGroup>
<EasyCachingCorePackageNotes>
1. Add GetAllKeysByPrefix.
2. Support zremrangebyscore
</EasyCachingCorePackageNotes>
<EasyCachingMemcachedPackageNotes>
1. Upgrading dependencies.
</EasyCachingMemcachedPackageNotes>
<EasyCachingRedisPackageNotes>
1. Upgrading dependencies.
2. Support zremrangebyscore
</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.
</EasyCachingAspectCorePackageNotes>
<EasyCachingCastlePackageNotes>
1. Upgrading dependencies.
</EasyCachingCastlePackageNotes>
<EasyCachingResponseCachingPackageNotes>
1. Upgrading dependencies.
</EasyCachingResponseCachingPackageNotes>
<EasyCachingJsonPackageNotes>
1. Upgrading dependencies.
</EasyCachingJsonPackageNotes>
<EasyCachingMessagePackPackageNotes>
1. Upgrading dependencies.
</EasyCachingMessagePackPackageNotes>
<EasyCachingProtobufPackageNotes>
1. Upgrading dependencies.
</EasyCachingProtobufPackageNotes>
<EasyCachingCSRedisPackageNotes>
1. Upgrading dependencies.
2. Support zremrangebyscore
</EasyCachingCSRedisPackageNotes>
<EasyCachingCSRedisBusPackageNotes>
1. Upgrading dependencies.
</EasyCachingCSRedisBusPackageNotes>
<EasyCachingRedisBusPackageNotes>
1. Upgrading dependencies.
</EasyCachingRedisBusPackageNotes>
<EasyCachingRabbitBusPackageNotes>
1. Upgrading dependencies.
2. Use DefaultObjectPoolProvider to get a DisposableObjectPool instead of a DefaultObjectPool
3. Restore queue model and consumer on disconnection
</EasyCachingRabbitBusPackageNotes>
<EasyCachingKafkaBusPackageNotes>
1. Upgrading dependencies.
</EasyCachingKafkaBusPackageNotes>
<EasyCachingZookeeperBusPackageNotes>
1. Upgrading dependencies.
</EasyCachingZookeeperBusPackageNotes>
<EasyCachingDiskPackageNotes>
1. Upgrading dependencies.
</EasyCachingDiskPackageNotes>
<EasyCachingLiteDBPackageNotes>
1. Upgrading dependencies.
</EasyCachingLiteDBPackageNotes>
<EasyCachingSTJsonPackageNotes>
1. Upgrading dependencies.
</EasyCachingSTJsonPackageNotes>
<EasyCachingMemoryPackageNotes>
1. Support Memory Pack.
</EasyCachingMemoryPackageNotes>
<EasyCachingFaskKVPackageNotes>
1. Support FaskKV.
</EasyCachingFaskKVPackageNotes>
</PropertyGroup>
</Project>
46 changes: 24 additions & 22 deletions build/version.props
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
<Project>
<PropertyGroup>
<EasyCachingCorePackageVersion>1.7.0</EasyCachingCorePackageVersion>
<EasyCachingMemcachedPackageVersion>1.7.0</EasyCachingMemcachedPackageVersion>
<EasyCachingRedisPackageVersion>1.7.0</EasyCachingRedisPackageVersion>
<EasyCachingSQLitePackageVersion>1.7.0</EasyCachingSQLitePackageVersion>
<EasyCachingInMemoryPackageVersion>1.7.0</EasyCachingInMemoryPackageVersion>
<EasyCachingHybridPackageVersion>1.7.0</EasyCachingHybridPackageVersion>
<EasyCachingAspectCorePackageVersion>1.7.0</EasyCachingAspectCorePackageVersion>
<EasyCachingCastlePackageVersion>1.7.0</EasyCachingCastlePackageVersion>
<EasyCachingResponseCachingPackageVersion>1.7.0</EasyCachingResponseCachingPackageVersion>
<EasyCachingJsonPackageVersion>1.7.0</EasyCachingJsonPackageVersion>
<EasyCachingMessagePackPackageVersion>1.7.0</EasyCachingMessagePackPackageVersion>
<EasyCachingProtobufPackageVersion>1.7.0</EasyCachingProtobufPackageVersion>
<EasyCachingCSRedisPackageVersion>1.7.0</EasyCachingCSRedisPackageVersion>
<EasyCachingRedisBusPackageVersion>1.7.0</EasyCachingRedisBusPackageVersion>
<EasyCachingCSRedisBusPackageVersion>1.7.0</EasyCachingCSRedisBusPackageVersion>
<EasyCachingRabbitBusPackageVersion>1.7.0</EasyCachingRabbitBusPackageVersion>
<EasyCachingKafkaBusPackageVersion>1.7.0</EasyCachingKafkaBusPackageVersion>
<EasyCachingZookeeperBusPackageVersion>1.7.0</EasyCachingZookeeperBusPackageVersion>
<EasyCachingDiskPackageVersion>1.7.0</EasyCachingDiskPackageVersion>
<EasyCachingMsExtPackageVersion>1.7.0</EasyCachingMsExtPackageVersion>
<EasyCachingLiteDBPackageVersion>1.7.0</EasyCachingLiteDBPackageVersion>
<EasyCachingSTJsonPackageVersion>1.7.0</EasyCachingSTJsonPackageVersion>
<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>
</PropertyGroup>
</Project>
63 changes: 48 additions & 15 deletions bus/EasyCaching.Bus.RabbitMQ/DefaultRabbitMQBus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ IPooledObjectPolicy<IModel> _objectPolicy

_subConnection = factory.CreateConnection();

_pubChannelPool = new DefaultObjectPool<IModel>(_objectPolicy);

var provider = new DefaultObjectPoolProvider();

_pubChannelPool = provider.Create(_objectPolicy);

_busId = Guid.NewGuid().ToString("N");

BusName = "easycachingbus";
Expand Down Expand Up @@ -148,20 +150,51 @@ public override void BaseSubscribe(string topic, Action<EasyCachingMessage> acti
queueName = _options.QueueName;
}

Task.Factory.StartNew(() =>
Task.Factory.StartNew(
() => StartConsumer(queueName, topic),
TaskCreationOptions.LongRunning);
}


private void StartConsumer(string queueName, string topic)
{
var model = _subConnection.CreateModel();

model.ExchangeDeclare(_options.TopicExchangeName, ExchangeType.Topic, true, false, null);
model.QueueDeclare(queueName, false, false, true, null);
// bind the queue with the exchange.
model.QueueBind(queueName, _options.TopicExchangeName, topic);
var consumer = new EventingBasicConsumer(model);
consumer.Received += OnMessage;
consumer.Shutdown += (sender, e) =>
{
var model = _subConnection.CreateModel();
model.ExchangeDeclare(_options.TopicExchangeName, ExchangeType.Topic, true, false, null);
model.QueueDeclare(queueName, false, false, true, null);
// bind the queue with the exchange.
model.QueueBind(queueName, _options.TopicExchangeName, topic);
var consumer = new EventingBasicConsumer(model);
consumer.Received += OnMessage;
consumer.Shutdown += OnConsumerShutdown;

model.BasicConsume(queueName, true, consumer);

}, TaskCreationOptions.LongRunning);
OnConsumerShutdown(sender, e);
OnConsumerError(queueName, topic, model);
};

consumer.ConsumerCancelled += (s, e) =>
{
OnConsumerError(queueName, topic, model);
};

model.BasicConsume(queueName, true, consumer);
}

private void OnConsumerError(string queueName, string topic, IModel model)
{
StartConsumer(queueName, topic);
BaseOnReconnect();
try
{
if (model?.IsOpen == true)
{
model?.Dispose();
}
}
catch
{
// nothing to do
}
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@
<ProjectReference Include="..\..\src\EasyCaching.Memcached\EasyCaching.Memcached.csproj" />
<ProjectReference Include="..\..\src\EasyCaching.Redis\EasyCaching.Redis.csproj" />
<ProjectReference Include="..\..\src\EasyCaching.ResponseCaching\EasyCaching.ResponseCaching.csproj" />
<ProjectReference Include="..\..\src\EasyCaching.SQLite\EasyCaching.SQLite.csproj" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\serialization\EasyCaching.Serialization.Json\EasyCaching.Serialization.Json.csproj" />
<ProjectReference Include="..\..\serialization\EasyCaching.Serialization.MessagePack\EasyCaching.Serialization.MessagePack.csproj" />
<ProjectReference Include="..\..\serialization\EasyCaching.Serialization.Protobuf\EasyCaching.Serialization.Protobuf.csproj" />
<ProjectReference Include="..\..\src\EasyCaching.SQLite\EasyCaching.SQLite.csproj" />
<ProjectReference Include="..\..\serialization\EasyCaching.Serialization.MemoryPack\EasyCaching.Serialization.MemoryPack.csproj" />
</ItemGroup>

</Project>
Loading

0 comments on commit ce90d95

Please sign in to comment.