示例#1
0
 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);
 }