public void Subscribe <T, TH>() where T : IntergrationEvent where TH : IIntergrationEventHandler <T> { var eventName = _manager.GetEventKey <T>(); if (!_connectFactory.isConnected) { _connectFactory.TryConnect(); } using (var channel = _connectFactory.Createchannel()) { _manager.AddSubscription <T, TH>(); var routingKey = _manager.GetEventKey <T>(); channel.QueueBind(_queueName, GB_EXCHANGE, routingKey); } }
public void Subscribe <T, TH>(TH integrationEventHandler) where T : IntegrationEvent where TH : IIntegrationEventHandler <T> { _substriptionsManager.AddSubscription <T, TH>(integrationEventHandler); }