Пример #1
0
 public PublishConfigurationMiddleware(IPublisherConfigurationFactory publisherFactory, PublishConfigurationOptions options = null)
 {
     PublisherFactory = publisherFactory;
     ExchangeFunc     = options?.ExchangeFunc ?? (context => context.GetPublishConfiguration()?.Exchange.Name);
     RoutingKeyFunc   = options?.RoutingKeyFunc ?? (context => context.GetPublishConfiguration()?.RoutingKey);
     MessageTypeFunc  = options?.MessageTypeFunc ?? (context => context.GetMessageType());
 }
Пример #2
0
 public PublishConfigurationMiddleware(IPublisherConfigurationFactory publisherFactory, ILogger <PublishConfigurationMiddleware> logger, PublishConfigurationOptions options = null)
 {
     PublisherFactory = publisherFactory ?? throw new ArgumentNullException(nameof(publisherFactory));
     ExchangeFunc     = options?.ExchangeFunc ?? (context => context.GetPublishConfiguration()?.Exchange.Name);
     RoutingKeyFunc   = options?.RoutingKeyFunc ?? (context => context.GetPublishConfiguration()?.RoutingKey);
     MessageTypeFunc  = options?.MessageTypeFunc ?? (context => context.GetMessageType());
     Logger           = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Пример #3
0
 public RequestConfigurationFactory(IPublisherConfigurationFactory publisher, IConsumerConfigurationFactory consumer)
 {
     _publisher = publisher;
     _consumer  = consumer;
 }
 public RequestConfigurationMiddleware(IPublisherConfigurationFactory publisher, IConsumerConfigurationFactory consumer)
 {
     _factory = new RequestConfigurationFactory(publisher, consumer);
 }