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>())); }
public void Publish <T>(T _event) where T : class, IEvent { var client = _rabbitMqServer.GetRabbitMQClient(); client.Publish(MessageFactory.CreateFromEvent(_event)); }
public void Execute <T>(T command) where T : class, ICommand { var client = _rabbitMqServer.GetRabbitMQClient(); client.Publish(MessageFactory.CreateFromCommand(command)); }