enqueue/dsn
Enqueue DSN is a small PHP library for parsing Data Source Name strings into structured connection configuration for the Enqueue messaging abstraction, making it easy to configure transports like AMQP, Redis, and others from a single URL.
A narrow but real enabler for queue portability. enqueue/dsn is not a queue implementation — it converts a DSN string (amqp://user:pass@host:5672/%2f, redis://…, sqs://…) into a structured, scheme-aware set of connection parameters. For a PM, its value is in the decisions it unblocks, not in the code it ships.
Adopt when:
Url or parse_url() will silently accept and mis-shape these.Look elsewhere when:
config/queue.php arrays. Laravel already parses its own connection strings; adding a second parser creates two sources of truth about what a valid connection is.Honest risk read for the record: repo-level stars (~2.2k) describe the Enqueue monorepo, not this package; zero dependents and a "development repository" notice mean we should plan on vendoring or forking rather than assuming upstream support. The blast radius is small — it's a pure function with no side effects — which is exactly what makes the risk acceptable.
For executives (one paragraph):
"We keep queue connection details in a standard DSN format. Adopting enqueue/dsn — a small, MIT-licensed PHP parser — lets us validate those connection strings up front and switch queue providers by changing configuration rather than code. Practically, it means less lock-in to any one broker, fewer production incidents caused by malformed connection settings, and a low-cost building block for any future feature where customers bring their own infrastructure. The cost is one small dependency and roughly a day of integration; the risk is contained because the library only parses strings — it holds no connections and no state."
For engineering (the substance):
ParsedDsn::parse($dsn) returns scheme-aware components, with per-scheme handling for AMQP (including URL-encoded vhosts) and Redis (DB index, sentinel). It is not a transport, not a worker, not a retry policy.QueueDsn value object or service bound in a service provider, parsed once at boot and cached with the config. Everything downstream consumes the parsed struct — never the raw string.parse_url()-based fallback behind the same interface so the dependency is swappable in an afternoon; (4) do not log raw DSNs — they contain passwords.How can I help you explore Laravel packages today?