Skip to content
This repository was archived by the owner on Apr 29, 2022. It is now read-only.

Commit 056daa4

Browse files
Updated libraries to 3.1.1, raised lib version to the 3.1.1 also
1 parent 56cc659 commit 056daa4

18 files changed

+77
-74
lines changed

examples/Examples.ConsumerConsole/Examples.ConsumerConsole.csproj

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@
55
<TargetFramework>netcoreapp3.1</TargetFramework>
66
</PropertyGroup>
77

8+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
9+
<NoWarn>1998</NoWarn>
10+
</PropertyGroup>
11+
812
<ItemGroup>
9-
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.0" />
10-
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.0" />
11-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.0" />
12-
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.0" />
13-
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="3.1.0" />
13+
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.1" />
14+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.1" />
15+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.1" />
16+
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.1" />
17+
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="3.1.1" />
1418
</ItemGroup>
1519

1620
<ItemGroup>
@@ -23,4 +27,4 @@
2327
</None>
2428
</ItemGroup>
2529

26-
</Project>
30+
</Project>

examples/Examples.ConsumerHost/ConsumingService.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using Microsoft.Extensions.Hosting;
22
using Microsoft.Extensions.Logging;
33
using RabbitMQ.Client.Core.DependencyInjection;
4-
using System;
54
using System.Threading;
65
using System.Threading.Tasks;
76

examples/Examples.ConsumerHost/Examples.ConsumerHost.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.0" />
10-
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.0" />
11-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.0" />
12-
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.1.0" />
13-
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.0" />
14-
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="3.1.0" />
9+
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.1" />
10+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.1" />
11+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.1" />
12+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.1.1" />
13+
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.1" />
14+
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="3.1.1" />
1515
</ItemGroup>
1616

1717
<ItemGroup>
@@ -24,4 +24,4 @@
2424
</None>
2525
</ItemGroup>
2626

27-
</Project>
27+
</Project>

examples/Examples.Producer/Examples.Producer.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.0" />
9+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.1" />
1010
</ItemGroup>
1111

1212
<ItemGroup>
1313
<ProjectReference Include="..\..\src\RabbitMQ.Client.Core.DependencyInjection\RabbitMQ.Client.Core.DependencyInjection.csproj" />
1414
</ItemGroup>
1515

16-
</Project>
16+
</Project>

src/RabbitMQ.Client.Core.DependencyInjection/Extensions/WildcardExtensions.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public static class WildcardExtensions
1515
const string Separator = ".";
1616
const string SingleWordPattern = "*";
1717
const string MultipleWordsPattern = "#";
18-
18+
1919
/// <summary>
2020
/// Construct tree (trie) structure of message handler route patterns.
2121
/// </summary>
@@ -39,8 +39,8 @@ public static IEnumerable<TreeNode> ConstructRoutesTree(IEnumerable<string> rout
3939
{
4040
var part = keyParts[index];
4141

42-
var existingNode = index == keyParts.Length - 1
43-
? currentTreeNode.FirstOrDefault(x => x.KeyPartition == part && x.IsLastNode)
42+
var existingNode = index == keyParts.Length - 1
43+
? currentTreeNode.FirstOrDefault(x => x.KeyPartition == part && x.IsLastNode)
4444
: currentTreeNode.FirstOrDefault(x => x.KeyPartition == part && !x.IsLastNode);
4545

4646
if (existingNode is null)
@@ -76,7 +76,7 @@ public static IEnumerable<string> GetMatchingRoutePatterns(IEnumerable<TreeNode>
7676
{
7777
return GetMatchingRoutePatterns(tree, routingKeyParts, depth: 0);
7878
}
79-
79+
8080
static IEnumerable<string> GetMatchingRoutePatterns(IEnumerable<TreeNode> tree, string[] routingKeyParts, int depth)
8181
{
8282
foreach (var node in tree)
@@ -118,15 +118,15 @@ static IEnumerable<string> GetMatchingRoutePatterns(IEnumerable<TreeNode> tree,
118118
}
119119
}
120120
}
121-
121+
122122
static IEnumerable<string[]> CollectRoutingKeyTails(IReadOnlyCollection<string> routingKeyParts, int depthStart)
123123
{
124124
for (var index = depthStart; index < routingKeyParts.Count; index++)
125125
{
126126
yield return routingKeyParts.Skip(index).ToArray();
127127
}
128128
}
129-
129+
130130
static string CollectRoutingKeyInReverseOrder(TreeNode node, string routingKey = "")
131131
{
132132
routingKey = string.IsNullOrEmpty(routingKey) ? node.KeyPartition : $"{node.KeyPartition}.{routingKey}";

src/RabbitMQ.Client.Core.DependencyInjection/MessageHandlerContainerBuilder.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class MessageHandlerContainerBuilder : IMessageHandlerContainerBuilder
1818
readonly IEnumerable<IAsyncMessageHandler> _asyncMessageHandlers;
1919
readonly IEnumerable<INonCyclicMessageHandler> _nonCyclicHandlers;
2020
readonly IEnumerable<IAsyncNonCyclicMessageHandler> _asyncNonCyclicHandlers;
21-
21+
2222
public MessageHandlerContainerBuilder(
2323
IEnumerable<MessageHandlerRouter> routers,
2424
IEnumerable<IMessageHandler> messageHandlers,
@@ -32,7 +32,7 @@ public MessageHandlerContainerBuilder(
3232
_nonCyclicHandlers = nonCyclicHandlers;
3333
_asyncNonCyclicHandlers = asyncNonCyclicHandlers;
3434
}
35-
35+
3636
/// <summary>
3737
/// Build message handler containers collection.
3838
/// </summary>
@@ -46,7 +46,7 @@ public IEnumerable<MessageHandlerContainer> BuildCollection()
4646
var container = CreateContainer(null, generalRouters);
4747
containers.Add(container);
4848
}
49-
49+
5050
var exchanges = _routers.Where(x => !x.IsGeneral).Select(x => x.Exchange).Distinct().ToList();
5151
foreach (var exchange in exchanges)
5252
{

src/RabbitMQ.Client.Core.DependencyInjection/MessageHandlerDependencyInjectionExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public static IServiceCollection AddAsyncNonCyclicMessageHandlerSingleton<T>(thi
169169
/// <returns>Service collection.</returns>
170170
public static IServiceCollection AddAsyncNonCyclicMessageHandlerSingleton<T>(this IServiceCollection services, IEnumerable<string> routePatterns) where T : class, IAsyncNonCyclicMessageHandler =>
171171
services.AddInstanceSingleton<IAsyncNonCyclicMessageHandler, T>(routePatterns.ToList());
172-
172+
173173
/// <summary>
174174
/// Add a transient message handler.
175175
/// </summary>
@@ -361,7 +361,7 @@ public static IServiceCollection AddAsyncNonCyclicMessageHandlerSingleton<T>(thi
361361
public static IServiceCollection AddAsyncNonCyclicMessageHandlerSingleton<T>(this IServiceCollection services, IEnumerable<string> routePatterns, string exchange)
362362
where T : class, IAsyncNonCyclicMessageHandler =>
363363
services.AddInstanceSingleton<IAsyncNonCyclicMessageHandler, T>(routePatterns.ToList(), exchange);
364-
364+
365365
static IServiceCollection AddInstanceTransient<TInterface, TImplementation>(this IServiceCollection services, IEnumerable<string> routePatterns)
366366
where TInterface : class
367367
where TImplementation : class, TInterface =>
@@ -371,7 +371,7 @@ static IServiceCollection AddInstanceSingleton<TInterface, TImplementation>(this
371371
where TInterface : class
372372
where TImplementation : class, TInterface =>
373373
services.AddInstanceSingleton<TInterface, TImplementation>(routePatterns, null);
374-
374+
375375
static IServiceCollection AddInstanceTransient<TInterface, TImplementation>(this IServiceCollection services, IEnumerable<string> routePatterns, string exchange)
376376
where TInterface : class
377377
where TImplementation : class, TInterface

src/RabbitMQ.Client.Core.DependencyInjection/MessageHandlingService.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ namespace RabbitMQ.Client.Core.DependencyInjection
1616
public class MessageHandlingService : IMessageHandlingService
1717
{
1818
const int ResendTimeout = 60;
19-
19+
2020
readonly IEnumerable<RabbitMqExchange> _exchanges;
2121
readonly IEnumerable<MessageHandlerContainer> _messageHandlerContainers;
2222
readonly ILogger<MessageHandlingService> _logger;
23-
23+
2424
public MessageHandlingService(
2525
IMessageHandlerContainerBuilder messageHandlerContainerBuilder,
2626
IEnumerable<RabbitMqExchange> exchanges,
@@ -30,7 +30,7 @@ public MessageHandlingService(
3030
_messageHandlerContainers = messageHandlerContainerBuilder.BuildCollection();
3131
_logger = logger;
3232
}
33-
33+
3434
/// <summary>
3535
/// Handle message receiving event.
3636
/// </summary>
@@ -85,7 +85,7 @@ public void HandleMessageReceivingEvent(BasicDeliverEventArgs eventArgs, IQueueS
8585

8686
IEnumerable<string> GetMatchingRoutePatterns(string exchange, string routingKey)
8787
{
88-
var tree = _messageHandlerContainers.FirstOrDefault(x => x.Exchange == exchange)?.Tree
88+
var tree = _messageHandlerContainers.FirstOrDefault(x => x.Exchange == exchange)?.Tree
8989
?? _messageHandlerContainers.FirstOrDefault(x => x.IsGeneral)?.Tree;
9090
if (tree is null)
9191
{
@@ -166,7 +166,7 @@ void ProcessMessage(string exchange, string message, IQueueService queueService,
166166
executedHandlers.Add(handlerType);
167167
RunNonCyclicMessageHandler(handler, message, matchingRoute, queueService);
168168
}
169-
}
169+
}
170170
}
171171
}
172172

src/RabbitMQ.Client.Core.DependencyInjection/Models/MessageHandlerContainer.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class MessageHandlerContainer
1515
/// Could be null.
1616
/// </remarks>
1717
public string Exchange { get; set; }
18-
18+
1919
/// <summary>
2020
/// Route patterns tree (trie) structure.
2121
/// </summary>
@@ -30,17 +30,17 @@ public class MessageHandlerContainer
3030
/// Dictionary of route patterns and message handlers connected by them.
3131
/// </summary>
3232
public IDictionary<string, IList<IMessageHandler>> MessageHandlers { get; set; }
33-
33+
3434
/// <summary>
3535
/// Dictionary of route patterns and async message handlers connected by them.
3636
/// </summary>
3737
public IDictionary<string, IList<IAsyncMessageHandler>> AsyncMessageHandlers { get; set; }
38-
38+
3939
/// <summary>
4040
/// Dictionary of route patterns and non-cyclic message handlers connected by them.
4141
/// </summary>
4242
public IDictionary<string, IList<INonCyclicMessageHandler>> NonCyclicHandlers { get; set; }
43-
43+
4444
/// <summary>
4545
/// Dictionary of route patterns and async non-cyclic message handlers connected by them.
4646
/// </summary>

src/RabbitMQ.Client.Core.DependencyInjection/Models/TreeNode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class TreeNode
2424
/// Child nodes.
2525
/// </summary>
2626
public List<TreeNode> Nodes { get; } = new List<TreeNode>();
27-
27+
2828
/// <summary>
2929
/// Flag is the node "last" - a single word that comes without any other parts.
3030
/// </summary>

0 commit comments

Comments
 (0)