alchemy/rabbitmq-management-client
PHP client for the RabbitMQ Management HTTP API. Query and manage queues, exchanges and more via synchronous Guzzle requests or asynchronous ReactPHP promises. Includes a Guarantee helper to ensure resources exist and match desired settings.
Pros:
php artisan queue:work) with programmatic control over RabbitMQ’s internals (e.g., monitoring, dynamic queue creation).Cons:
Queue facade or Illuminate\Queue).RabbitMQ as a driver) but not as a replacement for core queue operations.spatie/laravel-react) for real-time monitoring.php-amqplib for direct AMQP access) that better fit Laravel’s ecosystem?react/event-loop), which may need explicit installation (composer require react/event-loop).RabbitMQ queue driver (QUEUE_CONNECTION=rabbitmq in .env).php artisan rabbitmq:monitor using APIClient.$this->app->singleton(RabbitMQClient::class, function ($app) {
return APIClient::factory(['url' => config('rabbitmq.management_url')]);
});
spatie/laravel-react) or a separate process.| Step | Action | Dependencies |
|---|---|---|
| 1. Setup | Install package + ReactPHP (if async). | Composer, Laravel app. |
| 2. Configuration | Add RabbitMQ management URL to config/services.php. |
.env variables. |
| 3. Sync Integration | Build monitoring commands/jobs. | Laravel Artisan, Guzzle. |
| 4. Testing | Validate against staging RabbitMQ. | RabbitMQ instance. |
| 5. Async (Optional) | Integrate ReactPHP for real-time updates. | Event loop, Laravel React support. |
| 6. Error Handling | Implement retries/circuit breakers (e.g., spatie/laravel-queue-retries). |
Monitoring (e.g., Sentry). |
Log::error()) for API failures.php-amqplib) as a backup.| Scenario | Impact | Mitigation Strategy |
|---|---|---|
| RabbitMQ Management API down | Monitoring gaps, no queue control | Fallback to direct AMQP or alerting. |
| PHP/ReactPHP crashes | Async monitoring fails | Supervisor process restart. |
| Outdated client breaks API calls | Failed requests | Feature flags for deprecated endpoints. |
| Queue overload | Slow responses | Rate-limiting queries, caching results. |
| Laravel app restart | Async loop stops | Persistent process (e.g., systemd service). |
How can I help you explore Laravel packages today?