1
0
mirror of synced 2024-06-17 18:37:39 +00:00

Merge branch 'release/2.7.1' into develop

This commit is contained in:
Mark van Renswoude 2021-09-05 10:05:11 +02:00
commit 31621542b1
11 changed files with 24 additions and 21 deletions

View File

@ -144,7 +144,7 @@ namespace Tapeti.Cmd.ConsoleHelper
public void Confirm(string message) public void Confirm(string message)
{ {
WriteLine(message); WriteLine(message);
TryReadKey(false, out var _); TryReadKey(false, out _);
} }

View File

@ -1,5 +1,4 @@
using System; using CommandLine;
using CommandLine;
using RabbitMQ.Client; using RabbitMQ.Client;
using Tapeti.Cmd.ConsoleHelper; using Tapeti.Cmd.ConsoleHelper;

View File

@ -1,5 +1,4 @@
using System; using CommandLine;
using CommandLine;
using RabbitMQ.Client; using RabbitMQ.Client;
using RabbitMQ.Client.Exceptions; using RabbitMQ.Client.Exceptions;
using Tapeti.Cmd.ConsoleHelper; using Tapeti.Cmd.ConsoleHelper;

View File

@ -30,7 +30,7 @@ namespace Tapeti.Flow.Default
private readonly ConcurrentDictionary<Guid, CachedFlowState> flowStates = new ConcurrentDictionary<Guid, CachedFlowState>(); private readonly ConcurrentDictionary<Guid, CachedFlowState> flowStates = new ConcurrentDictionary<Guid, CachedFlowState>();
private readonly ConcurrentDictionary<Guid, Guid> continuationLookup = new ConcurrentDictionary<Guid, Guid>(); private readonly ConcurrentDictionary<Guid, Guid> continuationLookup = new ConcurrentDictionary<Guid, Guid>();
private readonly LockCollection<Guid> locks = new LockCollection<Guid>(EqualityComparer<Guid>.Default); private readonly LockCollection<Guid> locks = new LockCollection<Guid>(EqualityComparer<Guid>.Default);
private HashSet<string> validatedMethods = null; private HashSet<string> validatedMethods;
private readonly IFlowRepository repository; private readonly IFlowRepository repository;
private readonly ITapetiConfig config; private readonly ITapetiConfig config;

View File

@ -1,5 +1,4 @@
using System; using System.Reflection;
using System.Reflection;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
namespace Tapeti.Flow.FlowHelpers namespace Tapeti.Flow.FlowHelpers

View File

@ -1,6 +1,7 @@
using System; using System;
// ReSharper disable UnusedMemberInSuper.Global - public API // ReSharper disable UnusedMemberInSuper.Global - public API
// ReSharper disable UnusedMember.Global
namespace Tapeti.Config namespace Tapeti.Config
{ {

View File

@ -78,7 +78,8 @@ namespace Tapeti.Connection
}; };
var exceptionContext = new ExceptionStrategyContext(emptyContext, dispatchException); var exceptionContext = new ExceptionStrategyContext(emptyContext, dispatchException);
HandleException(exceptionContext); await HandleException(exceptionContext);
return exceptionContext.ConsumeResult; return exceptionContext.ConsumeResult;
} }
} }
@ -132,7 +133,7 @@ namespace Tapeti.Connection
catch (Exception invokeException) catch (Exception invokeException)
{ {
var exceptionContext = new ExceptionStrategyContext(context, invokeException); var exceptionContext = new ExceptionStrategyContext(context, invokeException);
HandleException(exceptionContext); await HandleException(exceptionContext);
await binding.Cleanup(context, exceptionContext.ConsumeResult); await binding.Cleanup(context, exceptionContext.ConsumeResult);
return exceptionContext.ConsumeResult; return exceptionContext.ConsumeResult;
@ -140,7 +141,7 @@ namespace Tapeti.Connection
} }
private void HandleException(ExceptionStrategyContext exceptionContext) private async Task HandleException(ExceptionStrategyContext exceptionContext)
{ {
if (cancellationToken.IsCancellationRequested && IgnoreExceptionDuringShutdown(exceptionContext.Exception)) if (cancellationToken.IsCancellationRequested && IgnoreExceptionDuringShutdown(exceptionContext.Exception))
{ {
@ -151,7 +152,7 @@ namespace Tapeti.Connection
try try
{ {
exceptionStrategy.HandleException(exceptionContext); await exceptionStrategy.HandleException(exceptionContext);
} }
catch (Exception strategyException) catch (Exception strategyException)
{ {

View File

@ -3,6 +3,8 @@ using System.Collections.Generic;
using System.Text; using System.Text;
using Tapeti.Config; using Tapeti.Config;
// ReSharper disable UnusedMember.Global - public API
namespace Tapeti.Default namespace Tapeti.Default
{ {
/// <inheritdoc /> /// <inheritdoc />
@ -17,9 +19,6 @@ namespace Tapeti.Default
/// </summary> /// </summary>
public class WithMessageLogging : ConsoleLogger public class WithMessageLogging : ConsoleLogger
{ {
/// <inheritdoc />
public WithMessageLogging() : base() { }
internal override bool IncludeMessageBody() => true; internal override bool IncludeMessageBody() => true;
} }

View File

@ -1,4 +1,5 @@
using Tapeti.Config; using System.Threading.Tasks;
using Tapeti.Config;
namespace Tapeti.Default namespace Tapeti.Default
{ {
@ -9,9 +10,10 @@ namespace Tapeti.Default
public class NackExceptionStrategy : IExceptionStrategy public class NackExceptionStrategy : IExceptionStrategy
{ {
/// <inheritdoc /> /// <inheritdoc />
public void HandleException(IExceptionStrategyContext context) public Task HandleException(IExceptionStrategyContext context)
{ {
context.SetConsumeResult(ConsumeResult.Error); context.SetConsumeResult(ConsumeResult.Error);
return Task.CompletedTask;
} }
} }
} }

View File

@ -1,4 +1,5 @@
using Tapeti.Config; using System.Threading.Tasks;
using Tapeti.Config;
// ReSharper disable UnusedMember.Global // ReSharper disable UnusedMember.Global
@ -20,9 +21,10 @@ namespace Tapeti.Default
public class RequeueExceptionStrategy : IExceptionStrategy public class RequeueExceptionStrategy : IExceptionStrategy
{ {
/// <inheritdoc /> /// <inheritdoc />
public void HandleException(IExceptionStrategyContext context) public Task HandleException(IExceptionStrategyContext context)
{ {
context.SetConsumeResult(ConsumeResult.Requeue); context.SetConsumeResult(ConsumeResult.Requeue);
return Task.CompletedTask;
} }
} }
} }

View File

@ -1,4 +1,5 @@
using Tapeti.Config; using System.Threading.Tasks;
using Tapeti.Config;
namespace Tapeti namespace Tapeti
{ {
@ -12,6 +13,6 @@ namespace Tapeti
/// </summary> /// </summary>
/// <param name="context">The exception strategy context containing the necessary data including the message context and the thrown exception. /// <param name="context">The exception strategy context containing the necessary data including the message context and the thrown exception.
/// Also proivdes methods for the exception strategy to indicate how the message should be handled.</param> /// Also proivdes methods for the exception strategy to indicate how the message should be handled.</param>
void HandleException(IExceptionStrategyContext context); Task HandleException(IExceptionStrategyContext context);
} }
} }