diff --git a/src/DotNetCore.CAP/Internal/IConsumerServiceSelector.Default.cs b/src/DotNetCore.CAP/Internal/IConsumerServiceSelector.Default.cs index cfec814..2c9d9b5 100644 --- a/src/DotNetCore.CAP/Internal/IConsumerServiceSelector.Default.cs +++ b/src/DotNetCore.CAP/Internal/IConsumerServiceSelector.Default.cs @@ -59,11 +59,6 @@ namespace DotNetCore.CAP.Internal return null; } - if (!string.IsNullOrEmpty(_capOptions.TopicNamePrefix)) - { - key = $"{_capOptions.TopicNamePrefix}.{key}"; - } - var result = MatchUsingName(key, executeDescriptor); if (result != null) { diff --git a/test/DotNetCore.CAP.Test/CustomConsumerSubscribeTest.cs b/test/DotNetCore.CAP.Test/CustomConsumerSubscribeTest.cs index bb5639b..d7b2be9 100644 --- a/test/DotNetCore.CAP.Test/CustomConsumerSubscribeTest.cs +++ b/test/DotNetCore.CAP.Test/CustomConsumerSubscribeTest.cs @@ -45,7 +45,7 @@ namespace DotNetCore.CAP.Test { var selector = _provider.GetRequiredService(); var candidates = selector.SelectCandidates(); - var bestCandidates = selector.SelectBestCandidate("Candidates.Foo", candidates); + var bestCandidates = selector.SelectBestCandidate($"{TopicNamePrefix}.Candidates.Foo", candidates); Assert.NotNull(bestCandidates); Assert.NotNull(bestCandidates.MethodInfo);