public RabbitResponseQueuePrepared(ILogger <RabbitResponseQueuePrepared> log, RabbitClientOptions option, IRabbitConnectionFactory connectionFactory) { _log = log; _option = option; _connectionFactory = connectionFactory; }
public RabbitEnvelopeSender( ITopologyService topologyService, IRabbitConnectionFactory connFactory) { _topologyService = topologyService; _connFactory = connFactory; }
/// <summary> /// Initializes a new instance of the <see cref="RabbitBroker" /> class. /// </summary> /// <param name="connectionFactory"> /// The <see cref="IRabbitConnectionFactory" /> to be used to create the channels to connect to the /// endpoints. /// </param> /// <param name="serviceProvider"> /// The <see cref="IServiceProvider" /> to be used to resolve the required services. /// </param> public RabbitBroker( IRabbitConnectionFactory connectionFactory, IServiceProvider serviceProvider) : base(serviceProvider) { _connectionFactory = connectionFactory; }
public SendMessagesService(IRabbitConnectionFactory rabbitConnectionFactory, ISettings settings) { Verify.RequireNotNull(rabbitConnectionFactory, "rabbitConnectionFactory"); Verify.RequireNotNull(settings, "settings"); this.rabbitConnectionFactory = rabbitConnectionFactory; this.settings = settings; }
/// <inheritdoc /> public RabbitQueueClient(RabbitClientOptions option, IRabbitResponseQueuePrepared queuePrepared, ILogger <RabbitQueueClient> log, IRabbitConnectionFactory connectionFactory, IOptions <RabbitRequestOption> opt) { _option = option ?? throw new ArgumentNullException(nameof(option)); _queuePrepared = queuePrepared; _log = log; _connectionFactory = connectionFactory; }
public RabbitHandler(IRabbitConnectionFactory connectionFactory) { listeners = new Dictionary <string, Func <object, Task> >(); _connection = connectionFactory.CreateConnection(); InitializeListeningChannel(); InitializeDeadLetterQueue(); InitializeSubscribers(); RegisterConsumer(); }
public RabbitEnvelopeReceiver( ITopologyService topologyService, IRabbitConnectionFactory connFactory) { _topologyService = topologyService; _connFactory = connFactory; _listeners = new Dictionary <IRegistration, RabbitListener>(); }
public RabbitEnvelopeReceiver( ITopologyService topologyService, IRabbitConnectionFactory connFactory) { _topologyService = topologyService; _connFactory = connFactory; _listeners = new Dictionary<IRegistration, RabbitListener>(); }
public RabbitTransportProvider( ITopologyService topologyService, IRabbitConnectionFactory connFactory) { _topoSvc = topologyService; _connFactory = connFactory; _listeners = new Dictionary<IRegistration, RabbitListener>(); _log = LogManager.GetLogger(this.GetType()); }
public RabbitTransportProvider( ITopologyService topologyService, IRabbitConnectionFactory connFactory, IRoutingInfoCache routingInfoCache) { _topoSvc = topologyService; _connFactory = connFactory; _routingInfoCache = routingInfoCache; _listeners = new Dictionary <IRegistration, RabbitListener>(); }
public RabbitTransportProvider( ITopologyService topologyService, IRabbitConnectionFactory connFactory, IRoutingInfoCache routingInfoCache) { _topoSvc = topologyService; _connFactory = connFactory; _routingInfoCache = routingInfoCache; _listeners = new Dictionary<IRegistration, RabbitListener>(); }
/// <summary> /// Initializes a new instance of the <see cref="RabbitConsumer" /> class. /// </summary> /// <param name="broker"> /// The <see cref="IBroker" /> that is instantiating the consumer. /// </param> /// <param name="endpoint"> /// The endpoint to be consumed. /// </param> /// <param name="behaviorsProvider"> /// The <see cref="IBrokerBehaviorsProvider{TBehavior}"/>. /// </param> /// <param name="connectionFactory"> /// The <see cref="IRabbitConnectionFactory" /> to be used to create the channels to connect to the /// endpoint. /// </param> /// <param name="serviceProvider"> /// The <see cref="IServiceProvider" /> to be used to resolve the needed services. /// </param> /// <param name="logger"> /// The <see cref="ISilverbackIntegrationLogger" />. /// </param> public RabbitConsumer( RabbitBroker broker, RabbitConsumerEndpoint endpoint, IBrokerBehaviorsProvider <IConsumerBehavior> behaviorsProvider, IRabbitConnectionFactory connectionFactory, IServiceProvider serviceProvider, ISilverbackIntegrationLogger <RabbitConsumer> logger) : base(broker, endpoint, behaviorsProvider, serviceProvider, logger) { _connectionFactory = connectionFactory; _logger = logger; }
/// <summary> /// Adds the RabbitMQ sink to serilog /// </summary> /// <param name="configuration">Serilog Sink Configuration.</param> /// <param name="rabbitConnectionFactory">The <see cref="IRabbitConnectionFactory" /> to use when creating the connection to RabbitMQ.</param> /// <param name="rabbitMessageBuilder">The <see cref="IRabbitMessageBuilder" /> to use when sending messages to RabbitMQ.</param> /// <param name="batchSizeLimit">Maximum locally queued message count before sending to RabbitMQ.</param> /// <param name="batchSubmitTimeSeconds">Maximum time to allow locally queued messages to be queued before sending to RabbitMQ.</param> /// <param name="textFormatter">The ITextFormatter to use when formatting the message. If null, this will default to the built-in Serilog JsonFormatter.</param> /// <param name="formatProvider">The IFormatProvider to use when formatting the message. If null, this will default to the standard .NET format provider.</param> /// <returns></returns> public static LoggerConfiguration RabbitMQ(this LoggerSinkConfiguration configuration, IRabbitConnectionFactory rabbitConnectionFactory, IRabbitMessageBuilder rabbitMessageBuilder, int batchSizeLimit = 50, int batchSubmitTimeSeconds = 2, ITextFormatter textFormatter = null, IFormatProvider formatProvider = null) { var sink = new RabbitMQSink(batchSizeLimit, TimeSpan.FromSeconds(batchSubmitTimeSeconds), textFormatter, formatProvider, rabbitConnectionFactory, rabbitMessageBuilder); return(configuration.Sink(sink)); }
/// <summary> /// Initializes a new instance of the <see cref="RabbitProducer" /> class. /// </summary> /// <param name="broker"> /// The <see cref="IBroker" /> that instantiated this producer. /// </param> /// <param name="endpoint"> /// The endpoint to produce to. /// </param> /// <param name="behaviorsProvider"> /// The <see cref="IBrokerBehaviorsProvider{TBehavior}" />. /// </param> /// <param name="serviceProvider"> /// The <see cref="IServiceProvider" /> to be used to resolve the needed services. /// </param> /// <param name="connectionFactory"> /// The <see cref="IRabbitConnectionFactory" /> to be used to create the channels to connect to the /// endpoint. /// </param> /// <param name="logger"> /// The <see cref="ISilverbackLogger" />. /// </param> public RabbitProducer( RabbitBroker broker, RabbitProducerEndpoint endpoint, IBrokerBehaviorsProvider <IProducerBehavior> behaviorsProvider, IRabbitConnectionFactory connectionFactory, IServiceProvider serviceProvider, ISilverbackIntegrationLogger <Producer> logger) : base(broker, endpoint, behaviorsProvider, serviceProvider, logger) { _connectionFactory = connectionFactory; _logger = logger; Task.Factory.StartNew( () => ProcessQueue(_cancellationTokenSource.Token), CancellationToken.None, TaskCreationOptions.LongRunning, TaskScheduler.Default); }
/// <summary> /// The Serilog sink that will send log messages to a RabbitMQ server /// </summary> /// <param name="batchSizeLimit">Maximum locally queued message count before sending to RabbitMQ.</param> /// <param name="batchSubmitTimeSeconds">Maximum time to allow locally queued messages to be queued before sending to RabbitMQ.</param> /// <param name="textFormatter">The ITextFormatter to use when formatting the message. If null, this will default to the built-in Serilog JsonFormatter.</param> /// <param name="formatProvider">The IFormatProvider to use when formatting the message. If null, this will default to the standard .NET format provider.</param> /// <param name="rabbitConnectionFactory">The <see cref="IRabbitConnectionFactory" /> to use when creating the connection to RabbitMQ.</param> /// <param name="rabbitMessageBuilder">The <see cref="IRabbitMessageBuilder" /> to use when sending messages to RabbitMQ.</param> public RabbitMQSink(int batchSizeLimit, TimeSpan batchSubmitTimeSeconds, ITextFormatter textFormatter, IFormatProvider formatProvider, IRabbitConnectionFactory rabbitConnectionFactory, IRabbitMessageBuilder rabbitMessageBuilder) : base(batchSizeLimit, batchSubmitTimeSeconds) { _formatProvider = formatProvider; _textFormatter = textFormatter ?? new JsonFormatter(renderMessage: true); _connectionFactory = rabbitConnectionFactory.GetConnectionFactory(); _rabbitMessageBuilder = rabbitMessageBuilder; _connection = _connectionFactory.CreateConnection(); _model = _connection.CreateModel(); _basicProperties = _model.CreateBasicProperties(); rabbitConnectionFactory.ConfigureBasicProperties(_basicProperties); }
public QueuePoller(IQueueSettings queueSettings, CancellationToken cancellationToken, IRabbitConnectionFactory rabbitConnectionFactory, IHeaderParser headerParser, IDocumentStore documentStore, IActiveQueuePollers activeQueuePollers, IStoreMessagesFactory storeMessagesFactory) { Verify.RequireNotNull(queueSettings, "queueSettings"); Verify.RequireNotNull(cancellationToken, "cancellationToken"); Verify.RequireNotNull(headerParser, "headerParser"); Verify.RequireNotNull(documentStore, "documentStore"); Verify.RequireNotNull(rabbitConnectionFactory, "rabbitConnectionFactory"); Verify.RequireNotNull(activeQueuePollers, "activeQueuePollers"); Verify.RequireNotNull(storeMessagesFactory, "storeMessagesFactory"); QueueSettings = queueSettings; this.cancellationToken = cancellationToken; this.rabbitConnectionFactory = rabbitConnectionFactory; this.headerParser = headerParser; this.documentStore = documentStore; this.activeQueuePollers = activeQueuePollers; this.storeMessagesFactory = storeMessagesFactory; Key = Guid.NewGuid(); messageMeter = Metric.Meter(string.Format("RabbitOperations.QueuePoller.Messages.{0}.{1}", QueueSettings.ApplicationId, QueueSettings.QueueName), Unit.Items, TimeUnit.Seconds, tags: new MetricTags("QueuePoller")); }
public LogController(IDeviceRepository deviceRepository,IRabbitConnectionFactory rabbitConnectionFactory) { _deviceRepository = deviceRepository; _rabbitConnectionFactory = rabbitConnectionFactory; }
public RabbitPublisher(IRabbitConnectionFactory connectionFactory) { _connectionFactory = connectionFactory; }
public RabbitService(IOptions <RabbitSettings> rabbitSettings, IRabbitConnectionFactory rabbitConnectionFactory) { _conn = rabbitConnectionFactory.CreateConnection(rabbitSettings.Value); _channel = _conn.CreateModel(); _channel.ExchangeDeclare(exchange: "users", type: ExchangeType.Fanout); }
public RabbitLogBus(IRabbitConnectionFactory rabbitConnectionFactory) { _rabbitConnectionFactory = rabbitConnectionFactory; _list=new List<ConnectedQueue>(); }
public TestHandler(IRabbitConnectionFactory connectionFactory) : base(connectionFactory) { BeforeExecution += QueueHandler_BeforeExecution; AfterExecution += QueueHandler_AfterExecution; }
public RabbitConnectionManager(IRabbitConnectionFactory connectionFactory, IRabbitChannelFactory rabbitChannelFactory, RabbitOptions options) { _connectionFactory = connectionFactory; _rabbitChannelFactory = rabbitChannelFactory; _options = options; }