Skip to content

Commit 447e354

Browse files
committed
Merge branch 'release/2.7.1'
2 parents 574a1fd + 66a0ec1 commit 447e354

11 files changed

+24
-21
lines changed

Tapeti.Cmd/ConsoleHelper/ConsoleWrapper.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public virtual void Dispose()
144144
public void Confirm(string message)
145145
{
146146
WriteLine(message);
147-
TryReadKey(false, out var _);
147+
TryReadKey(false, out _);
148148
}
149149

150150

Tapeti.Cmd/Verbs/PurgeVerb.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System;
2-
using CommandLine;
1+
using CommandLine;
32
using RabbitMQ.Client;
43
using Tapeti.Cmd.ConsoleHelper;
54

Tapeti.Cmd/Verbs/RemoveQueueVerb.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System;
2-
using CommandLine;
1+
using CommandLine;
32
using RabbitMQ.Client;
43
using RabbitMQ.Client.Exceptions;
54
using Tapeti.Cmd.ConsoleHelper;

Tapeti.Flow/Default/FlowStore.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public CachedFlowState(FlowState flowState, bool isPersistent)
3030
private readonly ConcurrentDictionary<Guid, CachedFlowState> flowStates = new ConcurrentDictionary<Guid, CachedFlowState>();
3131
private readonly ConcurrentDictionary<Guid, Guid> continuationLookup = new ConcurrentDictionary<Guid, Guid>();
3232
private readonly LockCollection<Guid> locks = new LockCollection<Guid>(EqualityComparer<Guid>.Default);
33-
private HashSet<string> validatedMethods = null;
33+
private HashSet<string> validatedMethods;
3434

3535
private readonly IFlowRepository repository;
3636
private readonly ITapetiConfig config;

Tapeti.Flow/FlowHelpers/MethodSerializer.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System;
2-
using System.Reflection;
1+
using System.Reflection;
32
using System.Text.RegularExpressions;
43

54
namespace Tapeti.Flow.FlowHelpers

Tapeti/Config/IMessageContext.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22

33
// ReSharper disable UnusedMemberInSuper.Global - public API
4+
// ReSharper disable UnusedMember.Global
45

56
namespace Tapeti.Config
67
{

Tapeti/Connection/TapetiConsumer.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ public async Task<ConsumeResult> Consume(string exchange, string routingKey, IMe
7878
};
7979

8080
var exceptionContext = new ExceptionStrategyContext(emptyContext, dispatchException);
81-
HandleException(exceptionContext);
81+
await HandleException(exceptionContext);
82+
8283
return exceptionContext.ConsumeResult;
8384
}
8485
}
@@ -132,15 +133,15 @@ await MiddlewareHelper.GoAsync(config.Middleware.Message,
132133
catch (Exception invokeException)
133134
{
134135
var exceptionContext = new ExceptionStrategyContext(context, invokeException);
135-
HandleException(exceptionContext);
136+
await HandleException(exceptionContext);
136137

137138
await binding.Cleanup(context, exceptionContext.ConsumeResult);
138139
return exceptionContext.ConsumeResult;
139140
}
140141
}
141142

142143

143-
private void HandleException(ExceptionStrategyContext exceptionContext)
144+
private async Task HandleException(ExceptionStrategyContext exceptionContext)
144145
{
145146
if (cancellationToken.IsCancellationRequested && IgnoreExceptionDuringShutdown(exceptionContext.Exception))
146147
{
@@ -151,7 +152,7 @@ private void HandleException(ExceptionStrategyContext exceptionContext)
151152

152153
try
153154
{
154-
exceptionStrategy.HandleException(exceptionContext);
155+
await exceptionStrategy.HandleException(exceptionContext);
155156
}
156157
catch (Exception strategyException)
157158
{

Tapeti/Default/ConsoleLogger.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
using System.Text;
44
using Tapeti.Config;
55

6+
// ReSharper disable UnusedMember.Global - public API
7+
68
namespace Tapeti.Default
79
{
810
/// <inheritdoc />
@@ -17,9 +19,6 @@ public class ConsoleLogger : IBindingLogger
1719
/// </summary>
1820
public class WithMessageLogging : ConsoleLogger
1921
{
20-
/// <inheritdoc />
21-
public WithMessageLogging() : base() { }
22-
2322
internal override bool IncludeMessageBody() => true;
2423
}
2524

Tapeti/Default/NackExceptionStrategy.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Tapeti.Config;
1+
using System.Threading.Tasks;
2+
using Tapeti.Config;
23

34
namespace Tapeti.Default
45
{
@@ -9,9 +10,10 @@ namespace Tapeti.Default
910
public class NackExceptionStrategy : IExceptionStrategy
1011
{
1112
/// <inheritdoc />
12-
public void HandleException(IExceptionStrategyContext context)
13+
public Task HandleException(IExceptionStrategyContext context)
1314
{
1415
context.SetConsumeResult(ConsumeResult.Error);
16+
return Task.CompletedTask;
1517
}
1618
}
1719
}

Tapeti/Default/RequeueExceptionStrategy.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Tapeti.Config;
1+
using System.Threading.Tasks;
2+
using Tapeti.Config;
23

34
// ReSharper disable UnusedMember.Global
45

@@ -20,9 +21,10 @@ namespace Tapeti.Default
2021
public class RequeueExceptionStrategy : IExceptionStrategy
2122
{
2223
/// <inheritdoc />
23-
public void HandleException(IExceptionStrategyContext context)
24+
public Task HandleException(IExceptionStrategyContext context)
2425
{
2526
context.SetConsumeResult(ConsumeResult.Requeue);
27+
return Task.CompletedTask;
2628
}
2729
}
2830
}

Tapeti/IExceptionStrategy.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Tapeti.Config;
1+
using System.Threading.Tasks;
2+
using Tapeti.Config;
23

34
namespace Tapeti
45
{
@@ -12,6 +13,6 @@ public interface IExceptionStrategy
1213
/// </summary>
1314
/// <param name="context">The exception strategy context containing the necessary data including the message context and the thrown exception.
1415
/// Also proivdes methods for the exception strategy to indicate how the message should be handled.</param>
15-
void HandleException(IExceptionStrategyContext context);
16+
Task HandleException(IExceptionStrategyContext context);
1617
}
1718
}

0 commit comments

Comments
 (0)