From 755f21039012b5e51bbdaaff9abf50d4ca8e30b9 Mon Sep 17 00:00:00 2001 From: patheems Date: Mon, 26 Oct 2020 14:39:07 +0100 Subject: [PATCH] Executor key not unique (#696) Co-authored-by: Patrick Heemskerk --- src/DotNetCore.CAP/Internal/ISubscribeInvoker.Default.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/DotNetCore.CAP/Internal/ISubscribeInvoker.Default.cs b/src/DotNetCore.CAP/Internal/ISubscribeInvoker.Default.cs index bbaeb6b..76458ef 100644 --- a/src/DotNetCore.CAP/Internal/ISubscribeInvoker.Default.cs +++ b/src/DotNetCore.CAP/Internal/ISubscribeInvoker.Default.cs @@ -35,10 +35,11 @@ namespace DotNetCore.CAP.Internal cancellationToken.ThrowIfCancellationRequested(); var methodInfo = context.ConsumerDescriptor.MethodInfo; + var serviceTypeInfo = context.ConsumerDescriptor.ServiceTypeInfo.Name; _logger.LogDebug("Executing subscriber method : {0}", methodInfo.Name); - var key = $"{methodInfo.Module.Name}_{methodInfo.MetadataToken}"; + var key = $"{methodInfo.Module.Name}_{serviceTypeInfo}_{methodInfo.MetadataToken}"; var executor = _executors.GetOrAdd(key, x => ObjectMethodExecutor.Create(methodInfo, context.ConsumerDescriptor.ImplTypeInfo)); using var scope = _serviceProvider.CreateScope();