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
Swarrot Bundle

Swarrot Bundle Laravel Package

swarrot/swarrot-bundle

SwarrotBundle integrates Swarrot message consumers into Symfony apps. Configure RabbitMQ connections, then define consumers with a processor service and a customizable middleware stack for signal handling, message limits, execution time, memory limits, and Doctrine integration.

View on GitHub
Deep Wiki
Context7

A symfony bundle for swarrot integration

Frequently asked questions about Swarrot Bundle
Does SwarrotBundle work with Laravel?
No. swarrot/swarrot-bundle is a Symfony bundle: it ships a Bundle subclass, a DependencyInjection extension, compiler passes and console commands, and Laravel never registers Symfony bundles. The framework-agnostic core library swarrot/swarrot can be used in Laravel, but you would have to write your own service provider and broker factory wiring, which is custom engineering. For most Laravel applications the native queue system or an AMQP queue package is the cheaper option.
How do I install swarrot/swarrot-bundle in a Symfony application?
Run composer require swarrot/swarrot-bundle, then register Swarrot\SwarrotBundle\SwarrotBundle in your kernel or bundles.php (with Symfony Flex this is usually automatic). After that, add a swarrot config block with at least a provider, a connection and one consumer. On a greenfield Symfony service this is typically an hour of work, not days.
Which Symfony and PHP versions does swarrot/swarrot-bundle support?
Version 2.7.0 requires PHP 8.2 or newer and Symfony 6.4 or newer, including Symfony 8.0 support. Older 2.x tags cover Symfony 4.x and 5.x estates, and 2.5.0 was the release that dropped support for Symfony below 5.4. There is no backport path if you are stuck on PHP 8.0 or 8.1, so pin to the tag that matches your platform.
How do I define a consumer and its processor service?
Under swarrot.consumers, give each consumer a name, a processor pointing at a Symfony service id that implements Swarrot\Processor\ProcessorInterface, and a middleware_stack. The bundle then exposes a console command named swarrot:consume:<consumer> that takes a queue name and an optional connection argument. Point your worker process manager at that command with the queue you want to drain.
Does the order of middleware_stack matter?
Yes, order is semantic. Each entry is a processor decorator that wraps the previous one, so the first configurator is the outermost layer and the last one sits closest to your processor. The README example is the main documentation for ordering, so treat the stack as part of your application logic and test it. Typical order is signal handling, max_messages, max_execution_time, memory_limit, then Doctrine connection and object manager processors.
How do I add a custom middleware processor or configurator?
Implement the processor against Swarrot's ProcessorInterface and register a configurator service that builds it from the extras in your config. Custom configurators must be declared as abstract: true services, an unintuitive dependency injection requirement that trips up new contributors, and they are collected by the bundle through tags. Note that the NewRelic, Sentry and RPC configurators were deprecated in 1.8.0 and removed in 2.0.0, so any observability integration is now a custom processor you own.
Does SwarrotBundle create RabbitMQ exchanges, queues and dead letter queues?
No, and that is deliberate. The bundle only consumes; it explicitly avoids mixing infrastructure topology management with message consumption and points at odolbeau/rabbit-mq-admin-toolkit instead. Exchanges, queues, bindings, DLQs and retry queues are yours to provision through that toolkit, Terraform or another IaC pipeline. Plan for that work before you adopt the bundle.
Which transports and connection providers are supported?
Two providers ship out of the box: pecl, which uses ext-amqp, and amqp_lib, which requires php-amqplib/php-amqplib. Connections are configured per name with an AMQP URL and a default_connection. To support something else, such as Redis, implement Swarrot's Broker\FactoryInterface and register it as a service tagged swarrot.provider_factory.
How do I test a Swarrot consumer?
Because consumers are plain services implementing ProcessorInterface and middleware are decorators, you can unit test your processor in isolation without a broker. For the full command path, run the swarrot:consume command through Symfony's CommandTester with a fake provider factory registered in the test container. The bundle ships no test doubles or in-memory transport, so the stubbing is on you.
Is swarrot/swarrot-bundle still maintained, and what should I use instead?
Releases are steady but sparse, with roughly 90 GitHub stars and very few Packagist dependents, which points to routine caretaking by one or two people rather than an active feature roadmap; bus factor is the real risk, not code quality. The code is sound and Symfony 8.0 support landed in 2.7.0, so it is reasonable for an existing Symfony monolith that already depends on Swarrot. If you are not already on Swarrot, compare it with Symfony Messenger's AMQP transport or a managed queue offering, and verify the latest version and release date on Packagist before pinning.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections