예제 #1
0
 public void Publish <TEvent>(TEvent @event) where TEvent : Event
 {
     RabbitFixtureBuilder.New("localhost", false)
     .WithOpenConection()
     .WithChannel()
     .QueueDeclare <TEvent>()
     .BasicPublish(@event);
 }
예제 #2
0
        public void Subscribe <TEvent, TEventHandler>()
            where TEvent : Event
            where TEventHandler : IEventHandler <TEvent>
        {
            _HandlerTypes.Add <TEvent, TEventHandler>();

            RabbitFixtureBuilder.New("localhost", true)
            .WithOpenConection()
            .WithChannel()
            .QueueDeclare <TEvent>()
            .BasicConsume <TEvent>(Consumer_Received);
        }