1. Go to this page and download the library: Download m6web/amqp-bundle 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/ */
m6web / amqp-bundle example snippets
$msg = ["key" => "value"];
$this->myProducer->publishMessage(serialize($msg)); // where "myProducer" refers to a configured producer (see producers documentation below)
$msg = $this->myConsumer->getMessage(); // where "myConsumer" refers to a configured consumer (see consumers documentation below)
private $myProducer;
public function __construct(\M6Web\Bundle\AmqpBundle\Amqp\Producer $myProducer) {
$this->myProducer = $myProducer;
}
public function myFunction() {
$msg = ["key" => "value"];
$this->myProducer->publishMessage(serialize($msg));
}
private $myProducer;
public function __construct(\M6Web\Bundle\AmqpBundle\Amqp\Locator $locator) {
$this->locator = $locator;
}
public function myFunction() {
$this->locator->getProducer('m6_web_amqp.produer.myproducer');
}
private $myConsumer;
public function __construct(\M6Web\Bundle\AmqpBundle\Amqp\Consumer $myConsumer) {
$this->myConsumer = $myConsumer;
}
public function myFunction() {
$this->myConsumer->getMessage();
}
private $myConsumer;
public function __construct(\M6Web\Bundle\AmqpBundle\Amqp\Locator $locator) {
$this->locator = $locator;
}
public function myFunction() {
$this->locator->getConsumer('m6_web_amqp.consumer.myconsumer');
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.