Esempio n. 1
0
        internal void Init()
        {
            _subscriptionManager.SetOnEventRemoved(EventRemoved);
            _subscriptionManager.SetOnQueueRemoved(QueueRemoved);

            _producer           = _connectionManager.Get();
            _producer.EventList = _subscriptionManager.GetProducerEvents();

            var queues = _subscriptionManager.GetConsumersQueues();

            foreach (var queue in queues)
            {
                var connection = _connectionManager.Get();
                connection.Queue          = queue;
                connection.EventList      = _subscriptionManager.GetConsumersEvents(queue);
                connection.ConsumerAction = messageReceived;
                connection.Start();
                _consumers.Add(connection);
            }
        }