Exemplo n.º 1
0
        private void CleanEnvironment(IModel channel, DomainEventSubscribersInformation information)
        {
            channel.ExchangeDelete(TestDomainEvents);

            foreach (var domainEventSubscriberInformation in information.All())
            {
                channel.QueueDelete(RabbitMqQueueNameFormatter.Format(domainEventSubscriberInformation));
            }
        }
Exemplo n.º 2
0
 private static void CreateQueue(IModel channel,
                                 DomainEventSubscribersInformation domainEventSubscribersInformation)
 {
     foreach (var subscriberInformation in domainEventSubscribersInformation.All())
     {
         var domainEventsQueueName = RabbitMqQueueNameFormatter.Format(subscriberInformation);
         var queue = channel.QueueDeclare(domainEventsQueueName,
                                          true,
                                          false,
                                          false);
         dynamic domainEvent = Activator.CreateInstance(subscriberInformation.SubscribedEvent);
         channel.QueueBind(queue, TestDomainEvents, (string)domainEvent.EventName());
     }
 }