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 Processing & Scalability:

    • Enables high-throughput background job processing in Laravel applications, reducing API latency and improving user experience.
    • Supports event-driven architectures by leveraging Redis for pub/sub patterns, enabling real-time updates and decoupled services.
    • Aligns with microservices roadmaps by providing a lightweight, scalable messaging layer for distributed systems.
  • Build vs. Buy Decision:

    • Buy: Eliminates the need to build a custom Redis queue system, reducing development time and maintenance overhead.
    • Cost-Effective: Leverages existing Redis infrastructure (e.g., AWS ElastiCache, Redis Labs) without additional licensing fees for managed queue services.
    • Symfony Ecosystem Integration: Seamlessly integrates with Symfony Messenger, offering a robust, well-tested solution for asynchronous workflows.
  • Key Use Cases:

    • Decoupling Heavy Workloads: Offload CPU-intensive tasks (e.g., PDF generation, image processing) from user-facing requests.
    • Scalable Worker Processing: Enable horizontal scaling of workers without shared state issues (vs. database locks or Laravel’s database queue).
    • Fault Tolerance & Retries: Built-in retry mechanisms with exponential backoff and dead-letter queues for failed jobs.
    • Multi-Tenancy: Isolate queues per tenant using Redis keyspaces or namespaces (e.g., tenant:{id}:queue).
    • Real-Time Systems: Integrate with Laravel Echo/Pusher for WebSocket updates or push notifications via Symfony Notifier.
    • Hybrid Cloud Deployments: Deploy Redis in cloud or on-prem environments for consistency across development, staging, and production.
  • Roadmap Enablers:

    • Feature Flags: Use Redis streams or pub/sub to manage dynamic feature rollouts.
    • Complex Workflows: Replace Laravel’s queue:work with Symfony Messenger for advanced workflows like sagas or 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 application already uses Symfony components (e.g., HTTP Client, UX, Messenger) or you’re open to adopting them.
    • You need low-latency, high-throughput messaging 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 to 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 allows us to offload slow, blocking tasks—like sending emails or generating reports—from our APIs, cutting response times by 90% or more while reducing server costs. By using Redis, which we already have in our stack, we avoid vendor lock-in and cut infrastructure costs compared to managed queue services like SQS or RabbitMQ. It’s scalable (handles 10,000+ messages per second), future-proof for microservices, and low-risk thanks to Symfony’s backing. The MIT license ensures no hidden costs, and it integrates seamlessly with our existing Laravel setup."

For Engineering:

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

  • Zero Boilerplate: Integrates seamlessly with Symfony Messenger’s existing workflows (handlers, buses, transports) with minimal Laravel-specific changes.
  • Redis Advantages: 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, with fixes for critical issues like duplicate message handling and Sentinel auth.

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 backup strategies 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: Implement custom monitoring for Redis queue metrics (e.g., message backlog, processing time)."*
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.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity