1. Go to this page and download the library: Download elielelie/laravel-activemq 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/ */
elielelie / laravel-activemq example snippets
use App\Jobs\ProcessOrder;
// Dispatch to the default queue
ProcessOrder::dispatch($order);
// Dispatch to a specific queue
ProcessOrder::dispatch($order)->onQueue('orders');
// Delay job execution by 10 minutes
ProcessOrder::dispatch($order)->delay(now()->addMinutes(10));
use Illuminate\Support\Facades\Queue;
$isConnected = Queue::connection('activemq')->healthCheck();
if (!$isConnected) {
// Handle connection failure
}