PHP code example of solcloud / rabbitmq-api-client
1. Go to this page and download the library: Download solcloud/rabbitmq-api-client 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/ */
solcloud / rabbitmq-api-client example snippets
use Solcloud\RabbitMQ\Api\Client;
use Solcloud\Http\Contract\IRequestDownloader;
use Solcloud\Http\Request;
/** @var IRequestDownloader $downloader */
$downloader = new \Solcloud\Curl\CurlRequest(); // for example solcloud/curl package
$request = new Request();
$rabbitmqApiClient = new Client($downloader, $request);
$rabbitmqApiClient->setApiUrl('http://rabbitmq-api');
$rabbitmqApiClient->setVhost('vhost');
$rabbitmqApiClient->setApiUsername('username');
$rabbitmqApiClient->setApiPassword('password');
echo $rabbitmqApiClient->getTotalMessageCountInQueue('queue-name');