Esempio n. 1
0
        public DynamicQueueListener(ILogger <DynamicQueueListener> logger, AppSettings appSettings,
                                    IQueueOperation <BasicDeliverEventArgs> queueOperation, IParseRouter <byte[]> parseRouter, IProcessManager processManager)
        {
            _logger         = logger;
            _appSettings    = appSettings;
            _queueOperation = queueOperation;
            _parseRouter    = parseRouter;
            _processManager = processManager;

            try
            {
                _queueOperation.CreateConnection();
                _queueBindingModels = _queueOperation.GetQueueList("Receiving");
            }
            catch (Exception e)
            {
                _logger.LogCritical(e, "Couldn't start DynamicQueueListener");
                throw;
            }
        }
Esempio n. 2
0
 public MainCycle(ILogger <MainCycle> logger, AppSettings appSettings,
                  IQueueOperation <BasicDeliverEventArgs> queueOperation, IEnumerable <IPortListener> portListeners)
 {
     _logger         = logger;
     _appSettings    = appSettings;
     _queueOperation = queueOperation;
     _portListeners  = portListeners;
     _clients        = new ConcurrentDictionary <int, IClient>();
     try
     {
         _queueOperation.CreateConnection();
         foreach (var item in _portListeners)
         {
             _queueOperation.DeclareQueueExchange(ExchangeName, item.Name, item.Name + "Route");
         }
     }
     catch (Exception e)
     {
         _logger.LogCritical(e, "Couldn't start Listener");
         throw;
     }
 }