1. Go to this page and download the library: Download vrnvgasu/php-rabbit-handler 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/ */
vrnvgasu / php-rabbit-handler example snippets
$connection = new Connection('localhost', 5672, 'guest', 'guest');
$queue = new Queue('hello', false, false, false, false);
$exchange = new Exchange('direct_logs', 'direct', false, false, false);
$binding = new Binding();
$binding = new Binding('key');
$helper = new AMQPHelper($connection, $queue, $exchange, $binding);
$consume = new Consume('', false, false,false, false);
use ATC\Jobs\TestJob;
TestJob::dispatch($param1, $param2, $param3);
class TestJob extends BaseJob
{
//
}
protected function handle($param1, $param2, $param3)
{
// Parameters will be passed to this class automatically
// You can do something with them and get some $data
// In the same method, you need to transfer the payload to the method `payload` for `producer`
$this->setPayload($data);
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.