Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Rabbitmq Simplebus Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Getting Started

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:

  1. 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.

  2. Register the bundle in AppKernel (Symfony 2/3 era):

    $bundles[] = new SyliusLabs\RabbitMqSimpleBusBundle\RabbitMqSimpleBusBundle();
    
  3. Look first at:

    • DependencyInjection/Configuration.php — the only reliable source for config keys.
    • Resources/config/services.xml — service IDs and tags.
    • The README and the underlying simple-bus/rabbitmq-bundle docs, since this bundle largely wires SimpleBus to RabbitMQ.
  4. 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'
    
  5. 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.

Implementation Patterns

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:

  • Run a small Symfony worker service alongside Laravel and communicate through RabbitMQ directly.
  • Publish messages from Laravel using php-amqplib and consume them in the Symfony app, matching SimpleBus’s envelope/serialization format.
  • Prefer Symfony Messenger if you control the Symfony side, or Laravel’s native queue if you control the Laravel side.

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.

Gotchas and Tips

  • Abandoned and low-adoption. Last release 2017, 11 stars, 0 dependents. Expect stale dependency constraints and possible incompatibility with PHP 8 and modern Symfony. Do not introduce it into a new project.
  • Not Laravel-compatible. There is no Laravel service provider or queue driver. Installing it in Laravel will at best do nothing and at worst create dependency conflicts.
  • Config key drift. Older Symfony bundles often have undocumented config roots. Always read DependencyInjection/Configuration.php; do not trust blog posts or copied YAML.
  • Serialization failures are the most common runtime issue. A consumer that cannot deserialize a message may requeue it forever. Configure a dead-letter exchange/queue and inspect payloads in the RabbitMQ management UI.
  • Handler wiring. SimpleBus handlers usually need to be tagged or registered explicitly. If a message is consumed but “nothing happens,” check that the handler is registered on the correct bus and that the consumer is listening to the correct queue.
  • Long-running workers and Doctrine. Consumers are long-lived; clear the EntityManager periodically to avoid stale identity-map issues. Reconnect to RabbitMQ and the database on failures where possible.
  • Idempotency and retries. RabbitMQ guarantees at-least-once delivery. Make handlers safe to run twice. Implement retry limits and dead-letter routing rather than relying on infinite redelivery.
  • Debugging commands. Use 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.
  • Extension points. Custom middleware, custom serializers, and service overrides via compiler passes are the realistic customization routes. Since the package is small and old, expect to fork or copy the service definitions rather than rely on active upstream support.
  • Modern alternatives. For Symfony, evaluate Symfony Messenger with the AMQP transport. For Laravel, use the Laravel RabbitMQ queue driver or Horizon with Redis/SQS. Both are actively maintained and better documented than this bundle.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route