Ejemplo n.º 1
0
        public void RegisterCommand <T>() where T : class, ICommand
        {
            var client         = _rabbitMqServer.GetRabbitMQClient();
            var commandHandler = _container.GetInstance <ICommandHandler <T> >();

            client.Consume(QueueNamingFactory.GetCommandQueue <T>(), msg => commandHandler.Handle(msg.GetBody <T>()));
        }
Ejemplo n.º 2
0
        public void Publish <T>(T _event) where T : class, IEvent
        {
            var client = _rabbitMqServer.GetRabbitMQClient();

            client.Publish(MessageFactory.CreateFromEvent(_event));
        }
Ejemplo n.º 3
0
        public void Execute <T>(T command) where T : class, ICommand
        {
            var client = _rabbitMqServer.GetRabbitMQClient();

            client.Publish(MessageFactory.CreateFromCommand(command));
        }