internal override AggregateConsumingResult Reply(IInboundChannel inboundChannel, IOutboundChannel outboundChannel, IFallbackStrategy fallbackStrategy) { Message.Requeue(inboundChannel); return(this); }
internal virtual AggregateConsumingResult Reply(IInboundChannel inboundChannel, IOutboundChannel outboundChannel, IFallbackStrategy fallbackStrategy) { Message.Acknowledge(inboundChannel); return(this); }
internal override AggregateConsumingResult Reply(IInboundChannel inboundChannel, IOutboundChannel outboundChannel, IFallbackStrategy fallbackStrategy) { Message.Requeue(inboundChannel); return this; }
internal override AggregateConsumingResult Reply(IInboundChannel inboundChannel, IOutboundChannel outboundChannel, IFallbackStrategy fallbackStrategy) { fallbackStrategy.Apply(outboundChannel, Message); return(base.Reply(inboundChannel, outboundChannel, fallbackStrategy)); }
internal virtual AggregateConsumingResult Reply(IInboundChannel inboundChannel, IOutboundChannel outboundChannel, IFallbackStrategy fallbackStrategy) { Message.Acknowledge(inboundChannel); return this; }
private AggregateConsumingResult AggregateResult(Task<ConsumingResult[]> task, ConsumedMessageBase message, IFallbackStrategy fallbackStrategy) { return task.Result.OfType<Failure>().Any() ? BuildErrorResult(task.Result, fallbackStrategy) : new Messages.Success(message); }
protected ConsumingFailureBase(ConsumedMessageBase message, IFallbackStrategy fallbackStrategy, params Exception[] exceptions) : base(message) { _fallbackStrategy = fallbackStrategy; _exceptions = exceptions; }
public void FallbackBy(Func <IBroker, Queue, IFallbackStrategy> strategy) { if (strategy == null) { throw new ArgumentNullException(nameof(strategy)); } FallbackStrategy = strategy(_broker, _queue); }
private void Subscribe(Action<SubscriptionConfiguration> configure, Func<IConsumedMessageBuilder, SubscriptionConfiguration, ConsumerBase> func, IFallbackStrategy fallbackStrategy) { var configuration = new SubscriptionConfiguration(fallbackStrategy); configure(configuration); var builder = new ConsumedMessageBuilder(new SerializerFactory(), _resolver); _model.BasicConsume(_name, false, func(builder, configuration)); }
private AggregateConsumingResult BuildErrorResult(IEnumerable<ConsumingResult> results, IFallbackStrategy fallbackStrategy) { var exceptions = results.OfType<Failure>() .Select(_ => _.Exception) .ToArray(); if (Redelivered) return new ReiteratedConsumingFailure(this, fallbackStrategy, exceptions); return new ConsumingFailure(this, fallbackStrategy, exceptions); }
internal ConsumingFailure(ConsumedMessageBase message, IFallbackStrategy fallbackStrategy, params Exception[] exceptions) : base(message, fallbackStrategy, exceptions) { }
internal UnsupportedMessageConsumingFailure(ConsumedMessageBase message, IFallbackStrategy fallbackStrategy) : base(message, fallbackStrategy) { }
internal override AggregateConsumingResult Reply(IInboundChannel inboundChannel, IOutboundChannel outboundChannel, IFallbackStrategy fallbackStrategy) { fallbackStrategy.Apply(outboundChannel, Message); return base.Reply(inboundChannel, outboundChannel, fallbackStrategy); }
protected override ConsumingFailureBase Result(IFallbackStrategy fallbackStrategy) { return new UnsupportedMessageConsumingFailure(this, fallbackStrategy); }
public void SubscribeByAtMostOnce(Action<SubscriptionConfiguration> configure, IFallbackStrategy fallbackStrategy) { Subscribe(configure, (b, c) => new AtMostOnceConsumer(_model, b, c), fallbackStrategy); }
protected abstract ConsumingFailureBase Result(IFallbackStrategy fallbackStrategy);