|
@@ -18,6 +18,7 @@ class AMQPRemoteCommand extends ContainerAwareCommand
|
|
->setHelp('Run a command on an AMQP Consumer')
|
|
->setHelp('Run a command on an AMQP Consumer')
|
|
->addArgument('name', InputOption::VALUE_REQUIRED, 'Command to execute')
|
|
->addArgument('name', InputOption::VALUE_REQUIRED, 'Command to execute')
|
|
->addOption('args', null, InputOption::VALUE_OPTIONAL|InputOption::VALUE_IS_ARRAY, 'Optional Commands arguments. e.g. --args=key:value --args=key1:value1')
|
|
->addOption('args', null, InputOption::VALUE_OPTIONAL|InputOption::VALUE_IS_ARRAY, 'Optional Commands arguments. e.g. --args=key:value --args=key1:value1')
|
|
|
|
+ ->addOption('route', null, InputOption::VALUE_OPTIONAL, 'AMQP Route Key', '')
|
|
;
|
|
;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -35,7 +36,8 @@ class AMQPRemoteCommand extends ContainerAwareCommand
|
|
'args' => $args,
|
|
'args' => $args,
|
|
);
|
|
);
|
|
$producer = $this->getContainer()->get('old_sound_rabbit_mq.command_producer_producer');
|
|
$producer = $this->getContainer()->get('old_sound_rabbit_mq.command_producer_producer');
|
|
- $producer->publish(serialize(compact('name', 'args')));
|
|
|
|
|
|
+ $route = $input->getOption('route');
|
|
|
|
+ $producer->publish(serialize(compact('name', 'args')), $route);
|
|
|
|
|
|
$output->writeln('<info>Command executed!</info>');
|
|
$output->writeln('<info>Command executed!</info>');
|
|
} else {
|
|
} else {
|