sylius-labs/rabbitmq-simplebus-bundle
Sylius Labs RabbitMQ SimpleBus Bundle integrates RabbitMQ with SimpleBus to enable asynchronous message handling in Sylius and Symfony applications. It provides configuration for queues, exchanges, and consumers so commands and events can be processed reliably in the background.
This is a Symfony bundle, not a Laravel package. If you are working in a Laravel codebase, there is no service provider, no config/queue.php driver, and no Artisan integration. Treat it as relevant only if you are maintaining a Sylius/Symfony application that already uses SimpleBus.
Minimal steps in a Symfony/Sylius app:
Install with Composer:
composer require sylius-labs/rabbitmq-simplebus-bundle
Check composer.json first. The last release was in 2017, so it will likely require an old PHP/Symfony matrix and may not install alongside modern Laravel or Symfony versions.
Register the bundle in AppKernel (Symfony 2/3 era):
$bundles[] = new SyliusLabs\RabbitMqSimpleBusBundle\RabbitMqSimpleBusBundle();
Look first at:
DependencyInjection/Configuration.php — the only reliable source for config keys.Resources/config/services.xml — service IDs and tags.simple-bus/rabbitmq-bundle docs, since this bundle largely wires SimpleBus to RabbitMQ.Configure a connection, a producer, and a consumer. The exact YAML root varies by version, so verify it against Configuration.php before copying examples. The shape is typically:
rabbit_mq_simple_bus:
connections:
default:
host: '%rabbitmq_host%'
port: 5672
login: '%rabbitmq_user%'
password: '%rabbitmq_password%'
vhost: '/'
producers:
default:
connection: default
exchange: 'simple_bus'
consumers:
default:
connection: default
queue: 'simple_bus'
First use case: make a command asynchronous. Dispatch a SimpleBus command from a controller; the producer serializes it to RabbitMQ; a long-running CLI worker consumes it and invokes the matching command handler.
Laravel analogy: this is roughly dispatch(new SomeJob()) plus php artisan queue:work, except it is configured through Symfony DI and SimpleBus message buses rather than Laravel’s queue system. In a Laravel app, use vladimir-yuldashev/laravel-queue-rabbitmq, Laravel Horizon, or Symfony Messenger instead.
Async command bus. Route only side-effect-heavy commands to RabbitMQ: emails, exports, third-party syncs, image processing. Keep queries and request-critical commands synchronous. In SimpleBus terms, configure a command bus whose middleware includes the RabbitMQ producer for selected message classes.
Event fan-out. Publish domain events to an exchange and bind multiple queues, one per consumer. This is useful for Sylius order/payment events where several independent processes need to react without blocking the web request. Design consumers to be idempotent because RabbitMQ can redeliver.
Producer/consumer separation. The web process should only produce. Run consumers as long-lived CLI processes under Supervisor or systemd:
bin/console simple-bus:consume
The exact command depends on the SimpleBus RabbitMQ bundle version; confirm via bin/console list.
Message design. Keep message classes small, serializable, and stable. Prefer scalar IDs and value objects over full Doctrine entities. If you rename or move a message class, old queued messages may fail to deserialize. Use explicit message-name mapping if the bundle exposes it.
Middleware integration. SimpleBus middleware is the natural extension point for logging, timing, retries, and correlation IDs. Add middleware around both producer and consumer sides so you can trace a command from HTTP request to worker execution.
Laravel-side integration. If you must bridge Laravel and a Sylius/Symfony service, do not force this bundle into Laravel. Options:
php-amqplib and consume them in the Symfony app, matching SimpleBus’s envelope/serialization format.Operational pattern. Use Docker Compose locally with the RabbitMQ management image, then inspect queues and exchanges in the management UI. In production, monitor queue depth, consumer count, redelivery rate, and dead-letter queues.
DependencyInjection/Configuration.php; do not trust blog posts or copied YAML.rabbitmqctl list_queues name messages consumers, the management UI, and worker logs. Add correlation IDs in middleware so you can match producer and consumer logs.How can I help you explore Laravel packages today?