/
vshmidt
/
masstransit
Обзор
Документация
Войти
/
vshmidt
/
masstransit
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/MassTransit/Middleware/ScheduleMessageRedeliveryFilter.cs
35 строк
1 KB
Chris Patterson
Integration of all external packages into MassTransit, split out into Abstractions, Middleware, and the core MassTransit assembly.
22 янв 2022, 18:24
22 янв 2022, 18:24
b5b4f50
Код
Авторство
О чём код?
namespace MassTransit.Middleware { using System.Diagnostics; using System.Threading.Tasks; using Context; /// <summary> /// Adds the scheduler to the consume context, so that it can be used for message redelivery /// </summary> public class ScheduleMessageRedeliveryFilter<TMessage> : IFilter<ConsumeContext<TMessage>> where TMessage : class { readonly RedeliveryOptions _options; public ScheduleMessageRedeliveryFilter(RedeliveryOptions options) { _options = options; } public void Probe(ProbeContext context) { context.CreateFilterScope("scheduleRedeliveryContext"); } [DebuggerNonUserCode] public Task Send(ConsumeContext<TMessage> context, IPipe<ConsumeContext<TMessage>> next) { context.GetOrAddPayload<MessageRedeliveryContext>(() => new ScheduleMessageRedeliveryContext<TMessage>(context, _options)); return next.Send(context); } } }