public void RemoveConsumer(string queue, EventType eventType, EventHandlerType eventHandlerType)
        {
            var evenTypes = _consumer.FirstOrDefault(q => q.Key == queue && q.Value.ContainsKey(eventType));

            if (evenTypes.Key != default)
            {
                if (!evenTypes.Value.ContainsKey(eventType))
                {
                    if (evenTypes.Value.Count == 0)
                    {
                        RemoveConsumer(queue);
                    }
                    return;
                }

                var eventHandlersType = evenTypes.Value[eventType];
                if (eventHandlersType.Contains(eventHandlerType))
                {
                    eventHandlersType.Remove(eventHandlerType);
                }

                if (eventHandlersType.Count == 0)
                {
                    RemoveConsumer(queue, eventType);
                }
            }
        }
        public void RemoveConsumer(EventType eventType, EventHandlerType eventHandlerType)
        {
            var evenTypes = _consumer.Where(q => q.Value.ContainsKey(eventType) && q.Value[eventType].Contains(eventHandlerType));

            foreach (var keys in evenTypes)
            {
                RemoveConsumer(keys.Key, eventType, eventHandlerType);
            }
        }
        public void AddOrUpdateConsumer(string queue, EventType eventType, EventHandlerType eventHandlerType)
        {
            if (!_consumer.ContainsKey(queue))
            {
                _consumer.Add(queue, new Dictionary <EventType, List <EventHandlerType> >());
            }
            var evenTypes = _consumer[queue];

            if (!evenTypes.ContainsKey(eventType))
            {
                evenTypes.Add(eventType, new List <EventHandlerType>());
            }
            var eventHandlersType = evenTypes[eventType];

            if (!eventHandlersType.Contains(eventHandlerType))
            {
                eventHandlersType.Add(eventHandlerType);
            }
        }