dlakomski/rabbitmq-bundle-bridge
symfony/amqplib-bundle). The bridge abstracts RabbitMQ’s complexity, aligning with Laravel’s service container and dependency injection.spatie/laravel-symfony-support) orqueue:work) would need migration to SimpleBus for consistency.config/packages/rabbit_mq.yaml) may clash with Laravel’s config/rabbitmq.php.serialize()).failed_jobs table or Horizon’s UI.spatie/laravel-symfony-support).symfony/dependency-injection).dispatch(), queue:work). Identify messages that could benefit from async/RabbitMQ.composer require dlakomski/rabbitmq-bundle-bridge simplebus/simple-bus simplebus/asynchronous-bundle
composer require spatie/laravel-symfony-support # For Symfony bundle support
php artisan vendor:publish --tag=rabbitmq-bundle-config
config/packages/rabbit_mq.yaml to Laravel’s config/rabbitmq.php.app/Messages/ProcessOrder.php).config/simple_bus.php:
'bus' => [
'simple_bus' => [
'message_factory' => SimpleBus\Message\MessageFactory::class,
'message_serializer' => 'json', // or custom
],
],
config/bundles.php (Symfony) or a Laravel service provider.public function register() {
$this->app->bind(\SimpleBus\RabbitMQBundleBridge\RabbitMQBridge::class, function ($app) {
return new \SimpleBus\RabbitMQBundleBridge\RabbitMQBridge(
$app->make(\SimpleBus\RabbitMQBundleBridge\RabbitMQConnection::class),
$app->make(\SimpleBus\Message\MessageFactory::class)
);
});
}
php artisan rabbitmq:consume).use SimpleBus\Message\Bus\MessageBus;
class ProcessOrderHandler {
public function __invoke(ProcessOrder $message) {
// Handle message
}
}
failed_jobs table; must implement custom logging.Jobs.ProcessOrder).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| RabbitMQ Broker Down | Messages lost if not persisted (unless publisher_confirms + persistent). |
Enable publisher confirms, use durable queues/exchanges. |
| Consumer Crashes | Unacked messages pile up, blocking producers. | Set TTL on messages, use dead-letter exchanges, monitor unacked count. |
| Network Partition | Producers/consumers unable to communicate. | Implement circuit breakers, retry logic with exponential |
How can I help you explore Laravel packages today?