sroze/enqueue-bridge
Bridges Laravel's queue system with Enqueue, letting Laravel jobs run over Enqueue transports such as AMQP and Redis. Add the service provider, configure a connection, dispatch jobs as usual, and let Enqueue handle producing and consuming messages.
enqueue/enqueue and one of enqueue/amqp-ext, enqueue/amqp-lib, enqueue/redis, enqueue/pheanstalk, etc.). Confirm your Messenger version first — the bridge targets the pre-4.3 transport API and will not compile against modern Messenger.composer require sroze/enqueue-bridge:0.2.0 — use the exact tag, not ^0.2. There is no Flex recipe and no 1.x, so treat it as a vendored adapter.src/ for the Messenger TransportInterface implementation and its factory, and DependencyInjection/ (or Resources/config/services.yaml) for how it auto-registers with the transport factory tag. Skim the factory's createTransport() method: the DSN parsing there tells you exactly which brokers are supported and in what string format.MessageBusInterface. If you are already running Enqueue in one part of the app and adopting Messenger in another, this is the seam that avoids running two competing brokers.messenger.transport_factory if it isn't auto-configured), then reference a transport in config/packages/messenger.yaml using an Enqueue-backed DSN, e.g. amqp://guest:guest@localhost:5672/%2f/messages or redis://localhost:6379/messages. Dispatch a message through the bus and confirm the payload lands on the broker with the broker's own tooling (rabbitmqctl, redis-cli, etc.) before touching the consumer.MessageBusInterface; the bridge serialises the Envelope and hands it to an Enqueue Producer from the Context. No changes are needed to your command/handler code — this is the point of the bridge. Keep the handler and the dispatch site ignorant of Enqueue.bin/console messenger:consume <transport> in a worker (Supervisor/systemd). The bridge wraps the Enqueue Consumer and polls the queue on each get(). Because polling is delegated to Enqueue, prefetch/qos settings come from the Enqueue Context, not from Messenger.ConnectionFactory/Context. Extract the DSN into an env var (ENQUEUE_DSN) and let Messenger transport config reference it. Mismatched DSNs are the single most common "messages disappear" cause with this package.SymfonySerializer with the same serializer setup you use in Messenger — and use it for both producing and consuming. If you have any legacy Enqueue producers already writing to the same queue, they must use the same serialiser and message format, or the consumer will silently fail to decode.Context in a service provider (for a legacy publisher), inject that same instance into the bridge factory rather than constructing a second one. That is the whole reason to choose a bridge over writing a Messenger transport from scratch.messenger.message_handler (or rely on _instanceof autoconfiguration) exactly as you would with the built-in transports. Do not add Enqueue-specific glue to handlers — that is the coupling the bridge is meant to hide.TransportInterface implementation; the bridge's transport class is thin enough to copy if the factory is the only obstacle.MessagePublisher service) and inject that into controllers. When it comes time to drop the bridge, only the one binding changes.repositories vendoring or a fork in your own namespace rather than depending on the upstream repo long-term. Budget a removal ticket at adoption time.TransportInterface, ReceiverInterface, Envelope handling) were reshaped significantly in Symfony 4.3 and again after. Before you rely on this, write one failing test that dispatches and consumes a round-trip message, and run it against your Symfony version. If it does not compile, do not patch the bridge — write a ~100-line transport of your own against the current interface.services.yaml by hand and may need to add the messenger.transport_factory tag yourself. Check bin/console debug:container --tag=messenger.transport_factory to confirm registration.routing maps to a transport; the queue/topic name is baked into the Enqueue DSN. Renaming a Messenger transport does not rename the queue. Change one, and you get a worker consuming an empty queue with no error.PhpSerializer and consumed by SymfonySerializer (or vice versa) typically surfaces as a decode exception on the consumer process, not on dispatch. Log at the worker level and inspect the raw payload with the broker CLI when in doubt.--time-limit/--memory-limit on messenger:consume matter more than usual; long-running workers leak connections on some brokers. Run workers under Supervisor with --time-limit=3600 and let Supervisor restart them.Context (Enqueue ships an Interop\Queue logger) and set it to debug; the bridge itself logs little. Use the broker's own inspection tooling for anything that "looks delivered but isn't consumed", and confirm the consumer's Context is pointed at the same vhost/namespace as the producer's.How can I help you explore Laravel packages today?