* @since 2.0 */ class MqController extends Controller { /** * This command echoes what you have entered as the message. * @param string $message the message to be echoed. */ public function actionIndex($message = 'rabbit mq begin') { echo $message . "\n"; $client = new PhpClient(); $responses = $client->call('mq begin'); //在这里传入发送给服务端脚本的内容 } /** * This command echoes what you have entered as the message. * @param string $message the message to be echoed. */ public function actionReceive($message = 'rabbit mq Receive') { $client = new PhpClient(); $responses = $client->call('direct type test','logs'); //在这里传入发送给服务端脚本的内容 var_dump("Receive Message OK"); } /** * This command echoes what you have entered as the message. * @param string $message the message to be echoed. */ public function actionSend($message = 'rabbit mq send') { echo $message . "\n"; $client = new PhpClient(); $responses = $client->call('direct type test','logs'); //在这里传入发送给服务端脚本的内容 var_dump("Send Message OK"); } }