caseyamcl/guzzle_retry_middleware
Guzzle middleware that automatically retries failed HTTP requests with configurable delays and retry conditions. Helps handle transient network errors, 5xx responses, and rate limiting with backoff strategies, improving resilience without changing client code.
options array) ensures non-blocking retries, critical for high-concurrency environments (e.g., webhooks, batch processing).Retry-After headers) and avoiding throttling penalties, now with improved parallel-request compatibility.guzzlehttp/retry-middleware), saving dev time and reducing technical debt. The change to options-based delays aligns with Guzzle’s modern practices, reducing friction for integration.Adopt if:
while loops with exponential backoff).Look elsewhere if:
guzzlehttp/retry-middleware or symfony/http-client.curl, HttpClient in Symfony).For Executives: "This package now handles API retries without blocking threads, making it ideal for high-concurrency systems like our [bulk data sync] or [real-time event processing]. For example, if our payment processor throttles requests during peak hours, this middleware will retry intelligently—without slowing down other API calls—saving dev time and keeping transactions flowing. It’s a low-risk, high-impact fix for API reliability, with zero performance overhead for parallel workloads. We’re proposing it for [Feature X], where [Y]% of API calls could benefit from non-blocking retries."
For Engineering:
*"This update fixes a critical blocking issue in v2.12 and earlier: retries now use Guzzle’s options array for delays instead of usleep, preventing thread starvation in parallel request scenarios. Key benefits:
Guzzle\Middleware::retry with this in 5 minutes—just update the options array:
$client = new Client([
'handler' => HandlerStack::create()->push(Middleware::retry()),
'delay' => 100, // Milliseconds (non-blocking)
]);
max_retries, delay, and except (exceptions to skip) via options.How can I help you explore Laravel packages today?