1. Go to this page and download the library: Download johndev/hermes 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/ */
use JohnDev\Hermes\Message;
use JohnDev\Hermes\Contracts\CarrierContract;
Hermes::consume(function(Message $message, CarrierContract $carrier) {
dump($message->body());
$message->ack();
$carrier->finish();
});
use JohnDev\Hermes\Facades\Hermes;
use JohnDev\Hermes\Message;
use JohnDev\Hermes\Contracts\CarrierContract;
Hermes::queue('queue-name')->consume(function(Message $message, CarrierContract $carrier) {
dump($message->body());
$message->ack();
$carrier->finish();
});
use JohnDev\Hermes\Facades\Hermes;
use JohnDev\Hermes\Message;
use JohnDev\Hermes\Contracts\CarrierContract;
$config = [
'consume' => [
'tag' => 'custom-tag',
'timeout' => 10,
]
];
Hermes::config($config)->consume(function(Message $message, CarrierContract $carrier) {
dump($message->body());
$message->ack();
$carrier->finish();
});