1
0
mirror of synced 2024-11-16 14:53:50 +00:00
Tapeti/Tapeti/Default/RequeueExceptionStrategy.cs
Mark van Renswoude 6c32665c8a [ci skip] Refactored how consume result is handled
Reimplemented the exception strategy and logging
Much XML documentation, such wow
2019-08-14 12:20:53 +02:00

29 lines
980 B
C#

using Tapeti.Config;
// ReSharper disable UnusedMember.Global
namespace Tapeti.Default
{
/// <inheritdoc />
/// <summary>
/// Example exception strategy which requeues all messages that result in an error.
/// </summary>
/// <remarks>
/// You probably do not want to use this strategy as-is in production code, unless
/// you are sure that all your exceptions are transient. A better way would be to
/// check for exceptions you know are transient. An even better way would be to
/// never requeue but retry transient errors internally. See the Tapeti documentation
/// for an example of this pattern:
///
/// https://tapeti.readthedocs.io/en/latest/
/// </remarks>
public class RequeueExceptionStrategy : IExceptionStrategy
{
/// <inheritdoc />
public void HandleException(IExceptionStrategyContext context)
{
context.SetConsumeResult(ConsumeResult.Requeue);
}
}
}