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.
swarrot/swarrot (the consumer/publisher library). Adopting it means we buy the worker lifecycle and middleware plumbing (MIT, zero cost) and only build our own ProcessorInterface classes — one class per message type, registered as a Symfony service.retry_attempts, retry_exchange, routing-key pattern), ack/requeue policy, exception catching, max-messages, max-execution-time and memory-limit cutoffs are declared per consumer in YAML/PHP config. That turns "how do we handle poison messages and restarts?" from tribal knowledge into code review, which is exactly the kind of decision a PM can point at in a postmortem.services_resetter, and Doctrine connection/object-manager re-ping address the classic "worker died at 3am" and "stale DB connection after idle" failure modes — decide whether we need these controls before committing to an architecture.messages_types (connection + exchange + routing key, overridable at publish time) and one generated swarrot:consume:<consumer> command per consumer let us scope ownership per team/domain and give each consumer a human-friendly command alias instead of raw AMQP wiring.odolbeau/rabbit-mq-admin-toolkit. That is a clean separation to adopt: application owns consuming, infrastructure owns topology.BlackholePublisher swaps out publishing in the test environment — no broker needed for CI, which directly affects developer velocity and CI cost.swarrot.provider_factory tag (e.g. Redis) and custom processor configurators mean the abstraction is not AMQP-locked, so a broker migration is a config change rather than a rewrite.Consider it when:
php-amqplib + a custom worker command, or SQS/Redis via the framework's queue component.Look elsewhere when:
To executives: This is a zero-cost, MIT-licensed integration layer for an existing, functioning PHP library — not a platform bet. It lets us add background message processing to our Symfony application with roughly one service class and a config block per message type, including retry, error handling, graceful shutdown and memory limits that we would otherwise write and maintain ourselves. There is no vendor lock-in: the underlying library and broker are both replaceable, and the bundle supports non-AMQP providers. The cost is low and reversible; the main caveat is that it is a small, single-maintainer open-source project, so we should pin the version and budget a modest amount of internal ownership rather than assume external support.
To engineering: It buys us DI wiring, auto-generated swarrot:consume:<name> commands, and a per-consumer middleware stack (signal handling, max-messages/execution-time, memory limit, Doctrine reconnect, exception catcher, ack, retry) that is configured rather than coded. We write ProcessorInterface implementations and register them as services; ordering in the stack is meaningful and explicit. Tests avoid the broker entirely via BlackholePublisher. Prerequisites: PHP 8.2+, Symfony 6.4+, and a decision on pecl amqp vs php-amqplib (the latter removes an extension from our build image). Known gaps we must own: broker topology provisioning, failure-queue inspection, and throughput/serialization concerns. If we are starting fresh with no existing Swarrot code, we should benchmark this against Symfony Messenger before committing — the exit path is clean, but the community support is not comparable.
How can I help you explore Laravel packages today?