public void Subscribe <TIntegrationEvent, TIntegrationEventHandler>() where TIntegrationEvent : IIntegrationEvent where TIntegrationEventHandler : IIntegrationEventHandler <TIntegrationEvent> { var eventName = _subscriptionManager.GetEventName <TIntegrationEvent>(); var containsKey = _subscriptionManager.HasSubscriptionsForEvent(eventName); if (containsKey) { return; } if (!_persistentConnection.IsConnected) { _persistentConnection.TryConnect(); } using (var channel = _persistentConnection.CreateModel()) { channel.QueueBind ( routingKey: eventName, exchange: _brokerName, queue: _queueName ); } _subscriptionManager.AddSubscription <TIntegrationEvent, TIntegrationEventHandler>(); }