2017-10-17 11:29:16 +00:00
|
|
|
|
using System;
|
|
|
|
|
using Tapeti.Config;
|
|
|
|
|
|
|
|
|
|
namespace Tapeti.Default
|
|
|
|
|
{
|
2019-08-15 09:26:55 +00:00
|
|
|
|
internal class ExceptionStrategyContext : IExceptionStrategyContext
|
2017-10-17 11:29:16 +00:00
|
|
|
|
{
|
2019-08-14 10:20:53 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The ConsumeResult as set by the exception strategy. Defaults to Error.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public ConsumeResult ConsumeResult { get; set; } = ConsumeResult.Error;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
public IMessageContext MessageContext { get; }
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
public Exception Exception { get; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ExceptionStrategyContext(IMessageContext messageContext, Exception exception)
|
2017-10-17 11:29:16 +00:00
|
|
|
|
{
|
|
|
|
|
MessageContext = messageContext;
|
|
|
|
|
Exception = exception;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2019-08-14 10:20:53 +00:00
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
public void SetConsumeResult(ConsumeResult consumeResult)
|
2017-10-17 11:29:16 +00:00
|
|
|
|
{
|
2019-08-14 10:20:53 +00:00
|
|
|
|
ConsumeResult = consumeResult;
|
2017-10-17 11:29:16 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|