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

Nats Php Bundle Laravel Package

elandlord/nats-php-bundle

A Symfony bundle that integrates NATS with Symfony Messenger using a NatsConnection, helping you publish and consume messages through NATS in Symfony applications.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for an async transport layer. If the platform already runs NATS (or is evaluating it against RabbitMQ/Kafka), this bundle is a thin adapter between NATS and Symfony Messenger. Buying here means we don't write and maintain a NATS transport, ack/nack semantics, and serializer glue ourselves. Building would cost roughly one to two engineer-weeks plus ongoing ownership of broker-specific edge cases.
  • Choosing/standardizing a message broker. This makes NATS cheap to try on a Symfony codebase: because it plugs into Messenger's existing transport, bus, and handler abstractions, the migration path away from Doctrine/RabbitMQ transports is a configuration change rather than a rewrite. That de-risks the broker decision and lets us defer a large commitment.
  • Committing to an event-driven roadmap. If the roadmap includes decoupled services, real-time notifications, or offloading background work (reports, media processing), this is a concrete enabler that doesn't require new PHP plumbing. It supports a phased rollout: internal RPC first, then background jobs, then real-time features.
  • Topology-as-code policy. Release v1.4.3 makes consumer configuration changes propagate to existing durable consumers instead of being silently ignored. That supports treating subject filters and delivery settings as versioned configuration — but it is also a policy decision: do we want production broker topology to mutate automatically on worker restart? That requires a review gate, not just a library update.
  • Feature scoping for multi-repo / multi-stack. This is a Symfony bundle, not Laravel. If the product surface is Laravel, this package is not a drop-in: Messenger and the bundle's DI/config integration don't exist there. The real decision is whether an event-driven initiative is scoped to the Symfony services only, or whether Laravel services need a parallel (likely custom) NATS client — which changes both cost and architecture.

When to Consider This Package

Adopt (or pilot) when all of these hold:

  • The service is Symfony 6.4+ with the Messenger component already in use, or the team is willing to introduce it.
  • NATS is already deployed or deliberately chosen, ideally with JetStream where durability matters. The bundle explicitly assumes a pre-existing connection; it is not batteries-included infrastructure.
  • There is a named, low-risk pilot workload — notifications, analytics, or a background job — rather than a system-wide migration.
  • The team accepts vendor/ownership risk: 4 stars, 0 dependents, single-vendor origin, README of one sentence, and release notes tied to internal ticket IDs (DEV-xxxx) and partly in Dutch. This reads as an agency's internal bundle published publicly. Budget for reading source rather than docs, and for the possibility of forking.

Look elsewhere or defer when:

  • The codebase is Laravel. No Messenger, different container/config conventions — this would be a rewrite, not an integration.
  • Strict change control over broker state. Automatic mutation of live durable consumers (v1.4.3) is a genuine hazard for regulated environments or teams without a rollback runbook; pin to v1.4.2 or require an explicit gating process.
  • Complex routing/fan-out or long retention/replay requirements — Kafka or a managed stream platform will fit better than NATS subjects.
  • You need a supported, SLA-backed dependency. No dependents and sparse documentation mean the bus factor is effectively the publishing agency. If the workload is revenue-critical, prefer a vendor-supported transport or budget to own the fork.
  • No appetite to operate a NATS cluster (TLS, auth, JetStream tuning, monitoring, alerting on lag/backlog). That operational cost sits outside this package and usually dwarfs the integration savings.

How to Pitch It (Stakeholders)

One-liner: A small open-source Symfony bundle that lets our PHP services publish and consume NATS messages through Symfony Messenger's existing machinery, so we can evaluate event-driven architecture without building a custom messaging client.

For executives: It lowers the cost of the broker and async-work decisions from "rewrite" to "configuration," and gives us a cheap, reversible pilot. The trade-off is dependency risk — the project is small, single-vendor, and minimally documented — so treat the pilot as a time-boxed evaluation with a fork-and-own fallback, not a permanent commitment. It also applies only to our Symfony services; Laravel work is out of scope and needs a separate estimate.

For engineering: The integration is genuinely thin: NATS as a Messenger transport, DI and bundle config, send/receive via existing handlers and middleware, Symfony Serializer for hydration. The v1.4.3 behavior change is the thing to plan for — consumer config edits now reach existing durable consumers on next worker attach, so consumer config belongs in code review and we should capture nats consumer info before and after deploys. Known gaps: some durable consumer fields can't be mutated in place (needs documented delete-and-recreate), serialization defaults to JSON, and NATS connection failures need explicit health checks and retry middleware rather than assumed error propagation. Recommendation: pilot on one non-critical workload, wrap the transport behind a port interface so we can swap it, and decide on adoption after we've measured throughput and operational overhead.

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.
steadrun/laravel-monitor
labyrinthe/connect-laravel
elmogy/layan
drewdan/sentinel-client
dskripchenko/laravel-llm
fatryst/nuonuo
stevenay/myanfont
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc
animalyoung/laravel-influxdb
onix-solutions/sms-telera
lonely-lights/prosetta
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin