/
vshmidt
/
masstransit
Обзор
Документация
Войти
/
vshmidt
/
masstransit
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/MassTransit/Configuration/MessageSchedulerExtensions.cs
40 строк
1 KB
Chris Patterson
Changed consume pipe so that simple ConsumeContext filters are PrePipe configured prior to the dispatch filter
26 янв 2022, 01:31
26 янв 2022, 01:31
6dc0f0b
Код
Авторство
О чём код?
namespace MassTransit { using System; using Configuration; public static class MessageSchedulerExtensions { /// <summary> /// Specify an endpoint to use for message scheduling /// </summary> /// <param name="configurator"></param> /// <param name="schedulerAddress"></param> public static void UseMessageScheduler(this IConsumePipeConfigurator configurator, Uri schedulerAddress) { if (configurator == null) throw new ArgumentNullException(nameof(configurator)); var pipeBuilderConfigurator = new MessageSchedulerPipeSpecification(schedulerAddress); configurator.AddPrePipeSpecification(pipeBuilderConfigurator); } /// <summary> /// Uses Publish (instead of Send) to schedule messages via the Quartz message scheduler. For this to work, a single /// queue should be used to schedule all messages. If multiple instances are running, they should be on the same Quartz /// cluster. /// </summary> /// <param name="configurator"></param> public static void UsePublishMessageScheduler(this IConsumePipeConfigurator configurator) { if (configurator == null) throw new ArgumentNullException(nameof(configurator)); var pipeBuilderConfigurator = new PublishMessageSchedulerPipeSpecification(); configurator.AddPrePipeSpecification(pipeBuilderConfigurator); } } }