Beispiel #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>()));
        }
Beispiel #2
0
        public void Publish <T>(T _event) where T : class, IEvent
        {
            var client = _rabbitMqServer.GetRabbitMQClient();

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

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