PHP code example of tiger / cmq
1. Go to this page and download the library: Download tiger/cmq library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
tiger / cmq example snippets
$options = [
'debug' => true,
'timeout' => 5,
];
// 创建 queue
$attr = new CMQAttr\CreateQueueAttr();
$attr->Action = 'CreateQueue';
$attr->queueName = 'world-hello';
$response = app('cmq')->createQueue($attr, $options, 'post');
dd($response->isOk(), $response->getBody());