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

Simple Client Laravel Package

enqueue/simple-client

Enqueue Simple Client combines Enqueue client classes with Symfony components into an easy-to-use SimpleClient facade for sending and consuming messages via queues. Part of the Enqueue ecosystem; see docs and support via the project site.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Asynchronous Workflows: Enables non-blocking execution of background tasks (e.g., order processing, notifications, data exports) to improve user experience and system responsiveness. Critical for Laravel applications handling high concurrency or long-running operations.
  • Microservices & Modularity: Facilitates decoupled architecture by abstracting message queue interactions, allowing teams to build independent services (e.g., payment processing, analytics) that communicate via queues. Aligns with Laravel’s service container and event system.
  • Scalability: Supports horizontal scaling by distributing workloads across queues, enabling the system to handle traffic spikes (e.g., Black Friday sales, viral content) without manual intervention. Complements Laravel’s queue workers and Horizon.
  • Event-Driven Architecture: Enables adoption of patterns like CQRS, event sourcing, or pub/sub for complex workflows (e.g., real-time dashboards, audit logs). Integrates seamlessly with Laravel’s event system and job queues.
  • Build vs. Buy: Avoids reinventing queue infrastructure, leveraging the mature Enqueue ecosystem (used by Forma-Pro and others) to reduce technical debt. MIT license ensures no vendor lock-in.
  • Use Cases:
    • High-Volume Batch Processing: Offload CPU-intensive tasks (e.g., video encoding, PDF generation) to worker queues.
    • Real-Time Features: Power live updates (e.g., chat apps, stock tickers) via push-based queues with low latency.
    • Resilience: Implement retries, dead-letter queues, and circuit breakers for failed jobs (e.g., payment retries, external API calls).
    • Hybrid Cloud/On-Prem: Use multi-transport support (RabbitMQ, Redis, filesystem) to adapt to different environments without rewriting logic.

When to Consider This Package

Adopt When:

  • Your Laravel app needs a lightweight, facade-based abstraction for message queues to reduce boilerplate compared to raw AMQP/RabbitMQ clients.
  • You’re already using Enqueue or Symfony components (e.g., enqueue/enqueue, symfony/config) and want consistency across microservices or monoliths.
  • Developer velocity is a priority (e.g., MVPs, prototypes) and you want to avoid custom queue implementations.
  • You require multi-transport support (e.g., RabbitMQ, Redis, filesystem) to switch backends without refactoring.
  • Your architecture demands asynchronous workflows but lacks dedicated queue infrastructure (e.g., shared hosting, limited server resources).
  • You need advanced queue features (e.g., priority queues, delayed jobs, dead-letter handling) beyond Laravel’s native queue system.

Look Elsewhere If:

  • You require advanced protocols like Kafka, SQS, or Azure Service Bus (consider language-specific SDKs or Enqueue’s Kafka extension).
  • Your team prefers language-specific SDKs (e.g., Python’s pika, Node.js’s amqplib) for tighter integration with non-PHP services.
  • You need enterprise-grade monitoring (e.g., Prometheus, distributed tracing) out of the box (consider Laravel Horizon, RabbitMQ Management Plugin, or AWS CloudWatch).
  • Your project is resource-constrained (e.g., embedded systems) and needs a minimalist alternative (e.g., Enqueue’s filesystem transport or database queues).
  • You’re locked into a cloud provider’s queue service (e.g., Google Pub/Sub, Azure Queue Storage) with proprietary SDKs.
  • You prioritize exactly-once processing or distributed transactions (consider Saga pattern or database-backed queues).

How to Pitch It (Stakeholders)

For Executives:

*"This package lets us handle background tasks—like processing orders, sending emails, or generating reports—without slowing down our web app. Imagine a ‘task list’ for our servers: instead of making users wait, we queue up work and process it efficiently in the background. It’s a proven, open-source solution (backed by Forma-Pro) that integrates seamlessly with our Laravel stack, reducing development time and improving scalability for features like real-time updates or batch jobs. The MIT license means no licensing costs, and the Enqueue ecosystem gives us flexibility to switch queue backends (e.g., RabbitMQ, Redis) later if needed.

Key Outcomes:

  • Faster user experiences: No more ‘processing…’ screens for time-consuming tasks.
  • Scalability: Handle 10x more traffic without adding servers or infrastructure.
  • Lower costs: Avoid custom development and maintenance for queue infrastructure.
  • Future-proof: Supports advanced features like priority queues, retries, and dead-letter handling for resilient workflows."*

For Engineering Teams:

*"The enqueue/simple-client package provides a unified, facade-based interface for message queues in PHP, abstracting the complexity of raw AMQP or RabbitMQ clients. Here’s why it’s a strong fit for our Laravel stack:

Why Use It?

  • Simplicity: Replace verbose queue code with a clean SimpleClient facade (e.g., SimpleClient::createConnection()).
  • Multi-Transport: Switch between RabbitMQ, Redis, or filesystem queues by changing a config—no refactoring.
  • Laravel Integration: Works with Symfony components (already in Laravel) and integrates with Laravel Queues via bridges (e.g., enqueue/laravel).
  • Advanced Features: Supports priority queues, delayed jobs, retries, and dead-letter queues out of the box.
  • Battle-Tested: Part of the Enqueue ecosystem, used in production by Forma-Pro and other teams.

Example Workflow:

// Dispatch a job via Laravel's queue system
dispatch(new ProcessOrderJob)->onQueue('enqueue');

// Or use the SimpleClient directly
$client = new SimpleClient();
$connection = $client->createConnection(['host' => 'amqp://localhost']);
$producer = $connection->createProducer();
$producer->send(new Message('Process order #123'));

Trade-offs:

  • Requires a message broker (e.g., RabbitMQ, Redis) for production—this isn’t a standalone queue server.
  • Limited to AMQP-based transports (no Kafka/SQS out of the box).
  • May introduce slight overhead compared to Laravel’s native queue system for simple use cases.

Next Steps:

  1. Spike: Test with a local RabbitMQ instance to validate performance and integration with Laravel’s queue system.
  2. Integration: Explore the Enqueue Laravel bridge for seamless job dispatching and consumer management.
  3. Monitoring: Plan for metrics (e.g., queue depth, job failures) using tools like:
    • Laravel Horizon (for dashboarding).
    • Enqueue StatsD (for real-time monitoring).
    • Prometheus + Grafana (for advanced observability).
  4. Fallback Strategy: Define how to handle broker downtime (e.g., fallback to database queues or retries).

Alternatives Considered:

Option Pros Cons Fit for Us?
Laravel Queues Simple, built-in Limited features, no multi-transport ❌ (Needs advanced features)
Raw AMQP Full control High maintenance, verbose ❌ (Too complex for team)
Custom Workers Tailored to needs Reinvents wheel, no retries ❌ (High risk)
Enqueue SimpleClient Lightweight, feature-rich Requires broker setup Best balance

Recommendation: Proceed with a pilot for non-critical background jobs (e.g., notifications, reports) to validate integration and performance before full adoption."*


For DevOps/Infrastructure Teams:

*"This package abstracts the complexity of message queues, but it does not replace the need for a message broker (e.g., RabbitMQ, Redis). Here’s what you need to know:

Infrastructure Requirements:

  • Broker Setup: Deploy and configure a message broker (e.g., RabbitMQ, Redis) to act as the queue backend. For production, consider:
    • RabbitMQ: High performance, supports clustering and HA.
    • Redis: Simpler setup, good for smaller workloads.
    • Cloud-Managed: AWS SQS, Google Pub/Sub, or Azure Service Bus (if locked into a provider).
  • Scaling Workers: Use Enqueue’s enqueue:consume command to manage workers (supports concurrent workers, dynamic scaling).
  • Monitoring: Integrate with tools like:
    • RabbitMQ Management Plugin (for RabbitMQ).
    • Redis CLI/Insights (for Redis).
    • Prometheus + Grafana (for custom metrics).

Deployment Considerations:

  • Docker: Use official RabbitMQ/Redis Docker images for consistency.
  • Kubernetes: Deploy brokers as StatefulSets with persistent storage.
  • High Availability: Configure broker clusters (e.g., RabbitMQ mirrored queues) for fault tolerance.
  • Security: Ensure TLS for broker connections and secure credentials (e.g., Laravel
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.
cadot.eu/make
besmartand-pro/php-quality-config
sentix/ai-chatbot
codifyo/ts-generator-bundle
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
christhompsontldr/laravel-inky