public RabbitMqDomainEventPublisher(
     IRabbitMqPublisher rabbitMqPublisher,
     IRabbitMqMessageFactory rabbitMqMessageFactory)
 {
     _rabbitMqPublisher      = rabbitMqPublisher;
     _rabbitMqMessageFactory = rabbitMqMessageFactory;
 }
Exemple #2
0
        private static async Task SendMessagesAsync(
            IRabbitMqPublisher rabbitMqPublisher,
            int count,
            Exchange exchange,
            RoutingKey routingKey,
            ConcurrentBag <Exception> exceptions)
        {
            var guid = Guid.NewGuid();

            try
            {
                for (var i = 0; i < count; i++)
                {
                    var rabbitMqMessage = new RabbitMqMessage(
                        $"{guid}-{i}",
                        new Metadata(),
                        exchange,
                        routingKey,
                        new MessageId(Guid.NewGuid().ToString("D")));
                    await rabbitMqPublisher.PublishAsync(CancellationToken.None, rabbitMqMessage).ConfigureAwait(false);
                }
            }
            catch (Exception e)
            {
                exceptions.Add(e);
            }
        }
Exemple #3
0
        public ExchangeHealthControlService(
            IExchangeCache exchangeCache,

            IExchangeConnectorService exchangeConnectorService,

            IRabbitMqPublisher <ExchangeHealthControlReport> exchangeHealthControlReportPublisher,

            IExchangeHealthControlResultRepository exchangeHealthControlResultRepository,

            IReloadingManager <ExchangeHealthControlJobSettings> settings,

            ILog log)
        {
            _exchangeCache = exchangeCache;

            _exchangeConnectorService = exchangeConnectorService;

            _exchangeHealthControlReportPublisher = exchangeHealthControlReportPublisher;

            _exchangeHealthControlResultRepository = exchangeHealthControlResultRepository;

            _settings = settings;

            _log = log;

            _failMessageThrottlingPeriodSec = _settings.CurrentValue.FailMessageThrottlingPeriodSeconds;
        }
Exemple #4
0
        public ExchangePollingService(
            IExchangeCache exchangeCache,

            IQuoteService quoteService,

            IExchangeConnectorService exchangeConnectorService,

            IRabbitMqPublisher <ExecutionReport> executionReportPublisher,

            IReloadingManager <ExchangePollingJobSettings> settings,

            ILog log)
        {
            _exchangeCache = exchangeCache;

            _quoteService = quoteService;

            _exchangeConnectorService = exchangeConnectorService;

            _executionReportPublisher = executionReportPublisher;

            _settings = settings;

            _log = log;
        }
 public RabbitMqDomainEventPublisher(
     IRabbitMqPublisher rabbitMqPublisher,
     IRabbitMqMessageFactory rabbitMqMessageFactory)
 {
     _rabbitMqPublisher = rabbitMqPublisher;
     _rabbitMqMessageFactory = rabbitMqMessageFactory;
 }
 public RpcConsumer(
     ILogger <RpcConsumer> logger,
     IRabbitMqPublisher rabbitMqPublisher,
     IRabbitMqSubscriber rabbitMqSubscriber)
 {
     _logger             = logger;
     _rabbitMqPublisher  = rabbitMqPublisher;
     _rabbitMqSubscriber = rabbitMqSubscriber;
 }
        public RpcClient(
            ILogger <RpcClient> logger,
            IRabbitMqPublisher rabbitMqPublisher,
            IRabbitMqSubscriber rabbitMqSubscriber)
        {
            _logger             = logger;
            _rabbitMqPublisher  = rabbitMqPublisher;
            _rabbitMqSubscriber = rabbitMqSubscriber;

            _pendingMessages = new ConcurrentDictionary <string, TaskCompletionSource <string> >();
        }
Exemple #8
0
 public MessageController(IRabbitMqPublisher <SendMessageRequestDTO, SendMessageResponseDTO> sendMessagePublisher)
 {
     _sendMessagePublisher = sendMessagePublisher;
 }
        private static void SendMessages(
            IRabbitMqPublisher rabbitMqPublisher,
            int count,
            Exchange exchange,
            RoutingKey routingKey,
            ConcurrentBag<Exception> exceptions)
        {
            var guid = Guid.NewGuid();

            try
            {
                for (var i = 0; i < count; i++)
                {
                    var rabbitMqMessage = new RabbitMqMessage(
                        $"{guid}-{i}",
                        new Metadata(),
                        exchange,
                        routingKey,
                        new MessageId(Guid.NewGuid().ToString("D")));
                    rabbitMqPublisher.PublishAsync(CancellationToken.None, rabbitMqMessage).Wait();
                }
            }
            catch (Exception e)
            {
                exceptions.Add(e);
            }
        }
Exemple #10
0
 public RmqController(IRabbitMqPublisher publisher, IRpcClient <TestRequest, TestReply> rpcClient)
 {
     _publisher = publisher;
     _rpcClient = rpcClient;
     _client    = new HttpClient();
 }
Exemple #11
0
 public Publisher(IRabbitMqPublisher publisher)
 {
     _publisher = publisher;
 }