public ConsumerMessageHandlerMiddleware(IPipeBuilderFactory pipeBuilderFactory, IPipeContextFactory contextFactory, ConsumeOptions options = null) { ContextFactory = contextFactory; ConsumeFunc = options?.ConsumerFunc ?? (context => context.GetConsumer()); ConsumePipe = pipeBuilderFactory.Create(options?.Pipe ?? (builder => {})); ThrottledExecutionFunc = options?.ThrottleFuncFunc ?? (context => context.GetConsumeThrottleAction()); }
public ResponseConsumeMiddleware(IConsumerFactory consumerFactory, IPipeBuilderFactory factory, ResponseConsumerOptions options) { ResponseConfigFunc = options?.ResponseConfigFunc ?? (context => context.GetResponseConfiguration()); CorrelationidFunc = options?.CorrelationIdFunc ?? (context => context.GetBasicProperties()?.CorrelationId); DedicatedConsumerFunc = options?.UseDedicatedConsumer ?? (context => context.GetDedicatedResponseConsumer()); ConsumerFactory = consumerFactory; ResponsePipe = factory.Create(options.ResponseReceived); }
public ResponseConsumeMiddleware(IConsumerFactory consumerFactory, IPipeBuilderFactory factory, ILogger <ResponseConsumeMiddleware> logger, ResponseConsumerOptions options) { ResponseConfigFunc = options?.ResponseConfigFunc ?? (context => context.GetResponseConfiguration()); CorrelationidFunc = options?.CorrelationIdFunc ?? (context => context.GetBasicProperties()?.CorrelationId); DedicatedConsumerFunc = options?.UseDedicatedConsumer ?? (context => context.GetDedicatedResponseConsumer()); ConsumerFactory = consumerFactory ?? throw new ArgumentNullException(nameof(consumerFactory)); Logger = logger ?? throw new ArgumentNullException(nameof(logger)); ResponsePipe = factory.Create(options.ResponseReceived); }
public RespondExceptionMiddleware(IPipeBuilderFactory factory, ILogger <ExceptionHandlingMiddleware> logger, RespondExceptionOptions options = null) : base(factory, logger, new ExceptionHandlingOptions { InnerPipe = options?.InnerPipe }) { DeliveryArgsFunc = options?.DeliveryArgsFunc ?? (context => context.GetDeliveryEventArgs()); ConsumeConfigFunc = options?.ConsumeConfigFunc ?? (context => context.GetConsumeConfiguration()); SaveAction = options?.SaveAction ?? ((context, information) => context.Properties.TryAdd(RespondKey.ResponseMessage, information)); }
public ConsumerMessageHandlerMiddleware( IPipeBuilderFactory pipeBuilderFactory, IPipeContextFactory contextFactory, ILogger <ConsumerMessageHandlerMiddleware> logger, ConsumeOptions options = null) { ContextFactory = contextFactory ?? throw new ArgumentNullException(nameof(contextFactory)); Logger = logger ?? throw new ArgumentNullException(nameof(logger)); ConsumeFunc = options?.ConsumerFunc ?? (context => context.GetConsumer()); ConsumePipe = pipeBuilderFactory.Create(options?.Pipe ?? (builder => {})); ThrottledExecutionFunc = options?.ThrottleFuncFunc ?? (context => context.GetConsumeThrottleAction()); }
public SubscriptionExceptionMiddleware( IPipeBuilderFactory factory, IChannelFactory channelFactory, ITopologyProvider provider, INamingConventions conventions, SubscriptionExceptionOptions options) : base(factory, new ExceptionHandlingOptions { InnerPipe = options.InnerPipe }) { _channelFactory = channelFactory; _provider = provider; _conventions = conventions; ChannelFunc = options?.ChannelFunc ?? ((c, f) => f.CreateChannelAsync()); }
public SubscriptionExceptionMiddleware( IPipeBuilderFactory factory, IChannelFactory channelFactory, ITopologyProvider provider, INamingConventions conventions, ILogger <ExceptionHandlingMiddleware> logger, SubscriptionExceptionOptions options) : base(factory, logger, new ExceptionHandlingOptions { InnerPipe = options.InnerPipe }) { _channelFactory = channelFactory ?? throw new ArgumentNullException(nameof(channelFactory)); _provider = provider ?? throw new ArgumentNullException(nameof(provider)); _conventions = conventions ?? throw new ArgumentNullException(nameof(conventions)); ChannelFunc = options?.ChannelFunc ?? ((c, f) => f.CreateChannelAsync()); }
public BusClient(IPipeBuilderFactory pipeBuilderFactory, IPipeContextFactory contextFactory, IChannelFactory factory) { _pipeBuilderFactory = pipeBuilderFactory; _contextFactory = contextFactory; }
public ExceptionHandlingMiddleware(IPipeBuilderFactory factory, ExceptionHandlingOptions options = null) { HandlingFunc = options?.HandlingFunc ?? ((exception, context, token) => Task.FromResult(0)); InnerPipe = factory.Create(options?.InnerPipe); }
public ExceptionHandlingMiddleware(IPipeBuilderFactory factory, ILogger <ExceptionHandlingMiddleware> logger, ExceptionHandlingOptions options = null) { Logger = logger ?? throw new ArgumentNullException(nameof(logger)); HandlingFunc = options?.HandlingFunc ?? ((exception, context, token) => Task.CompletedTask); InnerPipe = (factory ?? throw new ArgumentNullException(nameof(factory))).Create(options?.InnerPipe); }