public RabbitMQMessagePublisher(IRabbitMQConnectionFactory connectionFactory, IOptions <RabbitMQPublisherConfig <T> > config, ICloudEventFormatter cloudEventFormatter) { _connectionFactory = connectionFactory; _cloudEventFormatter = cloudEventFormatter; _config = config.Value; }
public RabbitMQQueueMonitor( ILogger <RabbitMQQueueMonitor <T> > logger, IOptions <RabbitMQConsumerOptions <T> > config, IRabbitMQConnectionFactory <T> connectionFactory ) { _options = config; _logger = logger; _connectionFactory = connectionFactory; }
private IMessageConsumer <string> GetRabbitMQMessageConsumer( IRabbitMQConnectionFactory rabbitMqConnectionFactory = null, RabbitMQConsumerOptions <string> options = null, IHostApplicationLifetime applicationLifetime = null) { rabbitMqConnectionFactory ??= GetDefaultConnectionFactoryMock().Object; applicationLifetime ??= FakeApplicationLifetime; var optionsWrapper = new OptionsWrapper <RabbitMQConsumerOptions <string> >(options ?? GetConfig()); return(new RabbitMQMessageConsumer <string>(FakeLogger, rabbitMqConnectionFactory, optionsWrapper, applicationLifetime, GetApplicationNameService(), new JsonEventFormatter())); }
private IMessageConsumer <string> GetRabbitMQMessageConsumer( IRabbitMQConnectionFactory <string>?rabbitMqConnectionFactory = null, RabbitMQConsumerOptions <string>?options = null, IHostApplicationLifetime?applicationLifetime = null) { rabbitMqConnectionFactory ??= GetDefaultConnectionFactoryMock <string>().Object; applicationLifetime ??= FakeApplicationLifetime; var optionsWrapper = Options.Create(options ?? GetConfig()); return(new RabbitMQMessageConsumer <string>(FakeLogger, rabbitMqConnectionFactory, optionsWrapper, applicationLifetime, GetApplicationNameService())); }
private ITypedMessagePublisher <byte[]> GetPublisher( IRabbitMQConnectionFactory connectionFactory = null, RabbitMQPublisherConfig <string> config = null) { connectionFactory ??= GetDefaultConnectionFactoryMock().Object; config ??= GetConfig(); var configMock = new Mock <IOptions <RabbitMQPublisherConfig <string> > >(); configMock.Setup(x => x.Value).Returns(config); return(new RabbitMQMessagePublisher <string>(connectionFactory, configMock.Object, new JsonEventFormatter())); }
public RabbitMQMessageConsumer(ILogger <RabbitMQMessageConsumer <T> > logger, IRabbitMQConnectionFactory connectionFactory, IOptions <RabbitMQConsumerConfig <T> > config, IHostApplicationLifetime applicationLifetime, IApplicationNameService applicationNameService, ICloudEventFormatter cloudEventFormatter) { _logger = logger; _connectionFactory = connectionFactory; _config = config.Value; _applicationLifetime = applicationLifetime; _applicationNameService = applicationNameService; _cloudEventFormatter = cloudEventFormatter; }
public RabbitMQMessageConsumer(ILogger <RabbitMQMessageConsumer <T> > logger, IRabbitMQConnectionFactory <T> connectionFactory, IOptions <RabbitMQConsumerOptions <T> > config, IHostApplicationLifetime applicationLifetime, IApplicationNameService applicationNameService) { _logger = logger; ConnectionFactory = connectionFactory; _options = config.Value; _applicationLifetime = applicationLifetime; _applicationNameService = applicationNameService; }
public RabbitMQMessagePublisher( IRabbitMQConnectionFactory <TOutput> connectionFactory, IOptions <RabbitMQPublisherOptions <TOutput> > config, IOptions <PublisherOptions> publisherOptions, CloudEventFormatter cloudEventFormatter ) { ConnectionFactory = connectionFactory; _options = config.Value; _publisherOptions = publisherOptions.Value; _cloudEventFormatter = cloudEventFormatter; }
private IRawMessagePublisher <string> GetPublisher( IRabbitMQConnectionFactory <string>?factory = null, RabbitMQPublisherOptions <string>?options = null, bool overwriteExchange = false, CloudEventFormat cloudEventFormat = CloudEventFormat.Protocol) { options ??= GetConfig(overwriteExchange); factory ??= GetDefaultConnectionFactoryMock <string>().Object; var optionsMock = Options.Create(options); return(new RabbitMQMessagePublisher <string>( factory, optionsMock, Options.Create(new PublisherOptions { CloudEventFormat = cloudEventFormat }), new JsonEventFormatter() )); }
public RabbitMQSubscriber(IRabbitMQConnectionFactory connectionFactory) { connection = connectionFactory.CreateConnection(); }
/// <summary> /// Initializes a new instance of the <see cref="TaskPublisher"/> class. /// </summary> public TaskPublisher(IRabbitMQConnectionFactory connectionFactory) { connection = connectionFactory.CreateConnection(); }
public RabbitMQReceiver(IRabbitMQConnectionFactory connectionFactory) { _connectionFactory = connectionFactory; }