- What is symfony/beanstalkd-messenger used for?
- It is a Symfony Messenger transport bridge for Beanstalkd, letting you send and consume messages through Beanstalkd queues using Messenger's sender and receiver interfaces. You configure it with a DSN and run workers with messenger:consume. It is intended for lightweight background job processing in applications that already use Symfony Messenger.
- Do I need this package to use Beanstalkd queues in Laravel?
- No. Laravel ships a first-class beanstalkd queue driver backed by pda/pheanstalk, so dispatching jobs and running queue:work already works without any extra bridge. This package is only relevant if you have deliberately adopted Symfony Messenger semantics such as envelopes, stamps, middleware pipelines, and per-message routing.
- How do I install symfony/beanstalkd-messenger in a Laravel application?
- Require symfony/messenger and the bridge with Composer, then register a transport using a Beanstalkd DSN in a service provider or Messenger configuration and define routing for your message classes. Run messenger:consume under Supervisor as a separate worker tier from your Laravel queue workers. The Symfony framework kernel is not required; buses and transports can be constructed manually.
- What does the Beanstalkd DSN look like for Symfony Messenger?
- Messenger transports are configured with a DSN such as beanstalkd://host:11300 followed by options like the tube name and timeouts. Check the package documentation for the exact scheme and supported query parameters, since option names differ between transport bridges. The tube acts as the queue name and must match what your producer and consumer use.
- Which Laravel and Symfony versions does symfony/beanstalkd-messenger support?
- The bridge constrains symfony/messenger, which must co-resolve with the Symfony components Laravel already pins in your lockfile. This usually resolves cleanly but can occasionally conflict, so verify it in a short spike before committing. Always test against the exact Laravel and PHP versions you deploy.
- Can I run this transport alongside Laravel's native queue system?
- Technically yes, but you would be running two messaging stacks against the same Beanstalkd instance with separate retry policies, worker processes, and definitions of failure. That doubles the mental model for anyone touching async work. If you adopt it, scope it to a bounded context rather than mixing it with Illuminate queue jobs.
- How do retries and failed messages work with Symfony Messenger and Beanstalkd?
- Messenger has its own retry strategy and failure transport configured on the bus and transport, which is entirely separate from Laravel's failed_jobs table and queue:retry commands. Beanstalkd adds at-least-once delivery and TTR expiry, so a message can be redelivered even after a successful handler run. Handlers must be idempotent regardless of package quality.
- Is symfony/beanstalkd-messenger safe to use in production?
- It is a narrow MIT-licensed bridge with a low bus factor: small adoption numbers and likely a single maintainer, so assume no vendor SLA. Beanstalkd itself is mature and stable but has a limited high-availability story and only persists jobs when started with a binlog. Plan a fork-and-vendor path before it becomes load-bearing, and monitor tube stats since there is no Horizon or first-class Telescope integration.
- How do I test messages sent through the Beanstalkd transport?
- Use Messenger's in-memory or test transport in your unit tests and assert on the bus rather than hitting a real Beanstalkd server. Keep a small set of integration tests running against a beanstalkd container to cover the transport boundary, DSN parsing, and tube configuration. This keeps tests fast while still validating the wiring.
- What are the alternatives to symfony/beanstalkd-messenger?
- For Laravel apps the obvious alternative is the built-in beanstalkd queue driver, which needs no extra abstraction. If you want Messenger semantics, other transport bridges such as AMQP or Doctrine have broader adoption and clearer exit paths you can swap the DSN for later. Choosing a transport you can migrate away from cheaply matters more than the bridge itself.