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

Messenger Test Laravel Package

zenstruck/messenger-test

Test helpers and assertions for symfony/messenger. Provides a TestTransport that intercepts and round-trips messages, lets you inspect queued items, assert counts/contents and processing states (acked/rejected), and optionally process queued messages in Kernel/Web tests.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Accelerating Development Velocity: Reduces manual testing effort for Symfony Messenger queue consumers, allowing PMs to prioritize feature development over repetitive test validation. The new manual retry control feature (#101) enables granular testing of retry logic, critical for debugging transient failures in async workflows (e.g., payment retries, external API calls).
  • Reliability & Scalability: Enables rigorous testing of async workflows with explicit retry toggling, ensuring edge cases (e.g., dead-letter queues, poison pills) are validated. Supports high-traffic features like real-time dashboards or batch processing where retry behavior directly impacts user experience.
  • Build vs. Buy: Justifies buying this lightweight package over custom test infrastructure, now with enhanced retry testing capabilities, saving engineering time and reducing technical debt for complex async scenarios.
  • Roadmap Alignment:
    • Resilience patterns: Supports testing of circuit breakers or exponential backoff in async services.
    • Microservices: Validates retry policies across decoupled services (e.g., order processing with external payment gateways).
    • Regulatory compliance: Ensures audit-ready queue processing by testing retry limits and failure paths.
  • Cross-Team Collaboration: Bridges gaps between backend (Messenger) and QA teams by standardizing retry-specific assertions, reducing miscommunication about failure handling.

When to Consider This Package

Adopt if:

  • Your app uses Symfony Messenger for async tasks (e.g., emails, payments, analytics) with retry logic (e.g., retry_after delays, dead-letter queues).
  • You need to test retry behavior explicitly (e.g., verifying retries are triggered/disabled for specific scenarios).
  • You lack mature queue testing tools (e.g., no custom retry-testing helpers or over-reliance on manual checks).
  • Your team prioritizes test automation for failure scenarios (e.g., transient errors, rate limits).
  • You’re building scalable event-driven systems where retry policies are critical (e.g., financial transactions, user notifications).

Look elsewhere if:

  • You’re not using Symfony Messenger (e.g., RabbitMQ, AWS SQS with custom consumers).
  • Your async logic is trivial (e.g., one-off cron jobs with no retry mechanisms).
  • You already have a dedicated testing framework for queues that includes retry testing (e.g., Pest + custom assertions).
  • Your team lacks PHP/Symfony expertise to integrate test helpers smoothly.
  • Your retry logic is handled externally (e.g., by a message broker like RabbitMQ) and doesn’t need consumer-level validation.

How to Pitch It (Stakeholders)

For Executives: "This package now includes manual retry control for Symfony Messenger tests, letting us automate validation of retry logic—critical for features like payment processing or external API integrations. With v1.14.0, we can catch retry-related bugs early, reducing production incidents for async workflows. This directly supports our roadmap for [X feature] by ensuring resilient event-driven systems, cutting QA time by 30%+ for retry-heavy paths."

For Engineering: *"zenstruck/messenger-test v1.14.0 adds:

  • Explicit retry toggling in tests (e.g., ->withoutRetries() or ->withRetries(3)).
  • Granular failure scenario testing (e.g., simulate a transient error and verify retries).
  • MIT-licensed, actively maintained (275+ stars, now with retry-focused features). Use it to test retry policies like a pro—just add it to composer.json and start validating your async resilience."*

For QA/DevOps: *"This update lets us standardize retry testing, so you can assert retry counts, delays, or failures in one line. Example:

$message->assertHandled()->withoutRetries(); // Verify no retries occurred

No more manual retry checks—focus on edge cases like poison pills or max retry limits."*

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.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
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
christhompsontldr/laravel-inky
spatie/mailcoach-vapor