PHP code example of lettermint / laravel-rabbitmq
1. Go to this page and download the library: Download lettermint/laravel-rabbitmq 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/ */
lettermint / laravel-rabbitmq example snippets
'rabbitmq' => [
'driver' => 'rabbitmq',
'connection' => 'default',
'queue' => 'default',
],
'strict_topology' => true,
'topology' => [
'exchanges' => [
'jobs' => ['type' => 'direct'],
'dlx' => ['type' => 'direct'],
],
'queues' => [
'default' => [
'bindings' => ['jobs' => ['default']],
'quorum' => true,
'dead_letter' => true,
'dead_letter_exchange' => 'dlx',
],
],
],
ProcessOrder::dispatch($orderId)->onConnection('rabbitmq');
ProcessOrder::dispatch($orderId)->onConnection('rabbitmq')->delay(now()->addSeconds(30));
bash
php artisan rabbitmq:declare --dry-run
php artisan rabbitmq:declare
php artisan rabbitmq:consume default --connection=rabbitmq --tries=3 --timeout=60
bash
php artisan rabbitmq:dlq-inspect default --limit=20
php artisan rabbitmq:replay-dlq default --id=JOB_UUID --dry-run
php artisan rabbitmq:replay-dlq default --id=JOB_UUID
php artisan rabbitmq:dlq-purge default --id=JOB_UUID --dry-run
bash
php artisan rabbitmq:health --json
php artisan rabbitmq:audit --strict --json
php artisan rabbitmq:probe --all --connection=rabbitmq --wait=60 --json