mucts/laravel-amqp is a Laravel package for amqpmessage sdk for laravel 8.
It currently has 1 GitHub stars and 21 downloads on Packagist (latest version 9.1.0).
Install it with composer require mucts/laravel-amqp.
Discover more Laravel packages by mucts
or browse all Laravel packages to compare alternatives.
Last updated

AMQPMessage SDK for Laravel 8
you will need to make sure your server meets the following requirements:
php ^8.0JSON PHP ExtensionSockets PHP ExtensionMBString PHP Extensionphp-amqplib/php-amqplib 3.0laravel/framework ^8.41composer require mucts/laravel-amqp
<?php
use MuCTS\Laravel\AMQP\Facades\AMQP;
use PhpAmqpLib\Exchange\AMQPExchangeType;
// send message
AMQP::connection('default')
->setExchange('test')
->setExchangeType(AMQPExchangeType::TOPIC)
->setQueue('test')
->publish('test');
use MuCTS\Laravel\AMQP\Commands\AMQPCommand;
use PhpAmqpLib\Message\AMQPMessage;
use Illuminate\Support\Facades\Log;
use PhpAmqpLib\Exchange\AMQPExchangeType;
class test extends AMQPCommand{
protected string $exchange = 'test';
protected string $queue = 'test';
protected string $exchangeType = AMQPExchangeType::TOPIC;
protected string $consumerTag = 'consumer';
protected ?string $connectionName = 'default';
protected bool $autoAsk = false;
protected function processMessage(AMQPMessage $message){
Log::info($message->getBody());
// message ask
$message->ack();
// message nack
$message->nack(true);
}
}
If config/amqp.php not exist, run below:
php artisan vendor:publish