public ChannelFactory(IConnectionFactory connectionFactory, RawRabbitConfiguration config, ChannelFactoryConfiguration channelConfig) { _connectionFactory = connectionFactory; _config = config; _channelConfig = channelConfig; _requestQueue = new ConcurrentQueue <TaskCompletionSource <IModel> >(); _channels = new LinkedList <IModel>(); ConnectToBroker(); Initialize(); }
public ChannelFactory(IConnectionFactory connectionFactory, RawRabbitConfiguration config, ChannelFactoryConfiguration channelConfig) { _connectionFactory = connectionFactory; _config = config; _channelConfig = channelConfig; _requestQueue = new ConcurrentQueue<TaskCompletionSource<IModel>>(); _channels = new LinkedList<IModel>(); ConnectToBroker(); Initialize(); }
public ChannelFactoryTests() { _connectionFactory = new Mock<IConnectionFactory>(); _connection = new Mock<IConnection>(); _firstChannel = new Mock<IModel>(); _secondChannel = new Mock<IModel>(); _thirdChannel = new Mock<IModel>(); _config = RawRabbitConfiguration.Local; _channelConfig = ChannelFactoryConfiguration.Default; _connectionFactory .Setup(c => c.CreateConnection(It.IsAny<IList<string>>())) .Returns(_connection.Object); }
public ChannelFactory(IConnectionFactory connectionFactory, RawRabbitConfiguration config, ChannelFactoryConfiguration channelConfig) { try { _connection = connectionFactory.CreateConnection(config.Hostnames); } catch (BrokerUnreachableException e) { _logger.LogError("Unable to connect to broker", e); throw e.InnerException; } _connectionFactory = connectionFactory; _config = config; _channelConfig = channelConfig; _requestQueue = new ConcurrentQueue <TaskCompletionSource <IModel> >(); _channels = new LinkedList <IModel>(); Initialize(); }
public ChannelFactory(IConnectionFactory connectionFactory, RawRabbitConfiguration config, ChannelFactoryConfiguration channelConfig) { try { _connection = connectionFactory.CreateConnection(config.Hostnames); } catch (BrokerUnreachableException e) { _logger.LogError("Unable to connect to broker", e); throw e.InnerException; } _connectionFactory = connectionFactory; _config = config; _channelConfig = channelConfig; _requestQueue = new ConcurrentQueue<TaskCompletionSource<IModel>>(); _channels = new LinkedList<IModel>(); Initialize(); }