Browse Source

Fix received storage message retry bug. #473

master
Savorboard 5 years ago
parent
commit
77052cb1ae
3 changed files with 11 additions and 2 deletions
  1. +1
    -1
      build/version.props
  2. +9
    -1
      src/DotNetCore.CAP/Internal/ISubscribeInvoker.Default.cs
  3. +1
    -0
      src/DotNetCore.CAP/Processor/IProcessor.NeedRetry.cs

+ 1
- 1
build/version.props View File

@@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<VersionMajor>3</VersionMajor> <VersionMajor>3</VersionMajor>
<VersionMinor>0</VersionMinor> <VersionMinor>0</VersionMinor>
<VersionPatch>0</VersionPatch>
<VersionPatch>1</VersionPatch>
<VersionQuality></VersionQuality> <VersionQuality></VersionQuality>
<VersionPrefix>$(VersionMajor).$(VersionMinor).$(VersionPatch)</VersionPrefix> <VersionPrefix>$(VersionMajor).$(VersionMinor).$(VersionPatch)</VersionPrefix>
</PropertyGroup> </PropertyGroup>


+ 9
- 1
src/DotNetCore.CAP/Internal/ISubscribeInvoker.Default.cs View File

@@ -9,6 +9,7 @@ using DotNetCore.CAP.Messages;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Internal; using Microsoft.Extensions.Internal;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Newtonsoft.Json.Linq;


namespace DotNetCore.CAP.Internal namespace DotNetCore.CAP.Internal
{ {
@@ -62,7 +63,14 @@ namespace DotNetCore.CAP.Internal
} }
else else
{ {
executeParameters[i] = message.Value;
if (message.Value is JObject jValue) //reading from storage
{
executeParameters[i] = jValue.ToObject(parameterDescriptors[i].ParameterType);
}
else
{
executeParameters[i] = message.Value;
}
} }
} }




+ 1
- 0
src/DotNetCore.CAP/Processor/IProcessor.NeedRetry.cs View File

@@ -55,6 +55,7 @@ namespace DotNetCore.CAP.Processor


foreach (var message in messages) foreach (var message in messages)
{ {
//the message.Origin.Value maybe JObject
await _messageSender.SendAsync(message); await _messageSender.SendAsync(message);


await context.WaitAsync(_delay); await context.WaitAsync(_delay);


Loading…
Cancel
Save