Weave Code
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

Redis Messenger Laravel Package

symfony/redis-messenger

Redis transport integration for Symfony Messenger, enabling queueing and async message handling backed by Redis. Part of the Symfony ecosystem, with links to contributing, issue reporting, and pull requests in the main Symfony repository.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Asynchronous Workflows & Performance Optimization:

    • Enables non-blocking task execution (e.g., sending emails, processing payments, generating reports) in Laravel applications, improving API response times and scalability.
    • Aligns with roadmaps for event-driven architectures, microservices decomposition, or serverless Laravel deployments (e.g., AWS Lambda + Redis).
  • Build vs. Buy:

    • Buy: Avoids reinventing Redis-based messaging; leverages Symfony’s battle-tested integration (vs. custom solutions or third-party services like RabbitMQ, SQS, or BullMQ).
    • Cost-Effective: Eliminates licensing fees for managed queue services while using existing Redis infrastructure (e.g., AWS ElastiCache, Redis Labs).
  • Use Cases:

    • Decoupling: Separate heavy computations (e.g., PDF generation, ML inference) from user-facing requests.
    • Scalability: Horizontal scaling of workers without shared state (vs. database locks or Laravel’s database queue).
    • Fault Tolerance: Retry failed jobs with exponential backoff (built into Symfony Messenger) and dead-letter queues.
    • Multi-tenancy: Isolate queues per tenant using Redis keyspaces or namespaces (e.g., tenant:{id}:queue).
    • Real-time Systems: Pair with Laravel Echo/Pusher for WebSocket updates or push notifications via Symfony Notifier.
    • Hybrid Cloud: Deploy Redis in cloud (AWS/GCP) or on-prem for consistency across environments.
  • Roadmap Enablers:

    • Feature Flags: Use Redis streams or pub/sub to manage dynamic feature rollouts.
    • Background Jobs: Replace Laravel’s queue:work with Symfony Messenger for complex workflows (e.g., sagas, compensating transactions).
    • Observability: Integrate with Laravel Scout or Prometheus for queue metrics (e.g., message latency, failure rates).

When to Consider This Package

  • Adopt if:

    • Your Laravel app already uses Symfony components (e.g., HTTP Client, UX, Messenger) or you’re open to adopting them.
    • You need low-latency, high-throughput messaging with sub-millisecond response times for CPU-bound (e.g., data processing) or I/O-bound (e.g., API calls) tasks.
    • Your team prefers PHP-native solutions over JavaScript (e.g., BullMQ) or Go (e.g., NSQ).
    • You’re using Redis for caching and want to consolidate infrastructure (reduce operational overhead).
    • Your workloads require advanced messaging patterns (e.g., fanout, RPC, request-reply) beyond Laravel’s queues.
    • You’re migrating from database queues (queue:table) and want to avoid lock contention or transaction overhead.
  • Look elsewhere if:

    • You need persistent queues (Redis is ephemeral; consider PostgreSQL with pgq, RabbitMQ, or Amazon SQS).
    • Your team lacks Symfony/Laravel expertise (steep learning curve for non-Symfony devs; consider Laravel’s native queues or Pheanstalk for Beanstalkd).
    • You require cross-language support (e.g., Python, Node.js)—use NATS, Kafka, or Redis Streams directly.
    • Your budget prohibits Redis licensing (Enterprise versions) or cloud costs (e.g., AWS ElastiCache).
    • You need built-in persistence (e.g., message history, replayability)—consider Laravel’s database queue or Amazon SNS/SQS.
    • Your use case is simple (e.g., sending emails, logging)—Laravel’s native queues may suffice.

How to Pitch It (Stakeholders)

For Executives:

"This package lets us offload slow, blocking tasks (e.g., sending emails, generating reports) from our APIs, cutting response times by 90%+ while reducing server costs. By using Redis—already in our stack—we avoid vendor lock-in and cut infrastructure costs vs. managed queue services like SQS or RabbitMQ. It’s scalable (handles 10K+ messages/sec), future-proof for microservices, and low-risk thanks to Symfony’s backing. The MIT license ensures no hidden costs."

For Engineering:

*"Symfony Redis Messenger gives us a production-ready, high-performance queue system for Laravel with:

  • Zero Boilerplate: Plugs into Symfony Messenger’s existing workflows (handlers, buses, transports) with minimal Laravel integration.
  • Redis Superpowers: Atomic operations, pub/sub, and streams for reliable delivery and exactly-once processing.
  • Performance: ~10x faster than database queues for high-throughput workloads (benchmarked against Laravel’s database queue).
  • Maintenance: Backed by Symfony’s team; fixes like duplicate message handling and Sentinel auth are pre-built.

Trade-offs:

  • Requires Redis (but we already use it for caching).
  • No built-in persistence (messages lost on Redis restart; mitigate with retry_delay or a backup strategy like Redis RDB/AOF).
  • PHP-only (but our stack is PHP-first).

Laravel Integration Plan:

  1. Spike: Benchmark against Laravel’s database queue for a high-volume endpoint (e.g., order processing).
  2. Pilot: Migrate a non-critical workflow (e.g., low-priority notifications) using a custom Queue adapter for Symfony Messenger.
  3. Scale: Roll out to critical paths, replacing queue:work with Symfony’s messenger:consume for better observability (e.g., Prometheus metrics).

Migration Risks:

  • Job Serialization: Laravel’s Illuminate\Bus\Queueable may need adaptation for Symfony’s Message interface.
  • Retry Logic: Symfony’s retry system differs from Laravel’s queue:failed table—require testing for edge cases (e.g., poison pills).
  • Monitoring: Integrate with Laravel Horizon or custom scripts to track message flow.

Next Steps:

  • Proof of Concept: Implement a Redis-backed queue for a single job type (e.g., SendWelcomeEmailJob).
  • Performance Testing: Compare latency/throughput vs. current database queue.
  • Team Buy-in: Train devs on Symfony Messenger’s Bus and Handler patterns."*

For DevOps/SRE:

*"Redis Messenger simplifies our queue infrastructure by:

  • Consolidating Redis Usage: Eliminates the need for separate queue databases (e.g., PostgreSQL) or external brokers (e.g., RabbitMQ).
  • High Availability: Leverages Redis Sentinel/Cluster for failover (configurable via Symfony’s DSN support).
  • Resource Efficiency: Redis is memory-efficient for queues vs. database tables with row locks.
  • Security: Supports TLS/SSL and Redis ACLs for secure message transmission.

Operational Considerations:

  • Monitoring: Use Redis INFO commands or tools like redis-cli --stat to track queue depth/latency.
  • Backups: Enable Redis RDB snapshots or AOF persistence to prevent message loss during restarts.
  • Scaling: Add workers horizontally by running multiple messenger:consume processes (like Laravel’s queue:work --daemon)."*
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.
directorytree/privacy-filter-classifier
directorytree/privacy-filter
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi
splash/scopes
splash/toolkit
testo/output-teamcity
testo/bridge-symfony
spatie/flare-daemon-runtime