PHP code example of maksimdimitrov / mdim-amqp-laravel
1. Go to this page and download the library: Download maksimdimitrov/mdim-amqp-laravel 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/ */
maksimdimitrov / mdim-amqp-laravel example snippets
namespace SomeNamespace;
use MdimAMQPLaravel\ReceiveJob;
class SomeClass extends ReceiveJob
{
public function handle()
{
echo 'message -> ' . $this->msg->body . PHP_EOL;
$this->msg->delivery_info['channel']->basic_ack($this->msg->delivery_info['delivery_tag']);
}
public static function getConnectionName()
{
return 'default'; // default is the connection name from config file, e.g. default or some-other-rabbitmq-service
}
public static function getQueueName()
{
return 'some-queue-name';
}
public static function getConsumerTag()
{
return '';
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.