- What is guzzlehttp/retry-subscriber used for?
- It is a Guzzle 4/5 event subscriber that automatically retries failed HTTP requests using configurable retry strategies, including exponential backoff. You can set retry limits, delays, and the exceptions or status codes that trigger another attempt. The package is deprecated and only targets the older Guzzle\Common\EventSubscriber and Guzzle\Plugin architecture.
- Is guzzlehttp/retry-subscriber compatible with Laravel?
- No supported Laravel release is compatible with it. Laravel 6 requires guzzlehttp/guzzle ^6.5 and Laravel 7+ requires ^7.0, while this package requires the older guzzle/guzzle 4/5 package name and plugin architecture. There is no version bump path because Guzzle 6 replaced the extension model with middleware.
- Does guzzlehttp/retry-subscriber work with Guzzle 6 or 7?
- No. Guzzle 6 removed the event-subscriber and plugin extension model that this package depends on and introduced the middleware stack. For Guzzle 6/7 you should compose a HandlerStack with GuzzleHttp\Middleware::retry() and a delay callable instead.
- How do I install guzzlehttp/retry-subscriber?
- Historically it was installed with Composer as guzzlehttp/retry-subscriber, but it is deprecated and scoped to Guzzle 4/5. Installing it in a modern Laravel project will conflict with Laravel's guzzlehttp/guzzle requirement. For new code, install Guzzle 7 or use Laravel's HTTP client and implement retries with first-party middleware.
- What replaces guzzlehttp/retry-subscriber in modern Laravel?
- Laravel's HTTP client provides Http::retry($times, $sleep, $when), which supports retry counts, delay in milliseconds, and a conditional callback. For raw Guzzle 7, use a HandlerStack with GuzzleHttp\Middleware::retry() and a delay callable for exponential backoff. Both are first-party and maintained.
- Can I use guzzlehttp/retry-subscriber with Laravel's HTTP client?
- No. Laravel's HTTP client wraps Guzzle 6/7 through guzzlehttp/guzzle, while this package attaches to the Guzzle 4/5 plugin system. The two dependency trees use different package names and incompatible extension points. Use Http::retry() instead.
- How does exponential backoff work in guzzlehttp/retry-subscriber?
- The package lets you plug in a retry strategy that decides whether to retry and how long to wait, including exponential backoff between attempts. In modern Guzzle, the same idea is expressed as a delay callable passed to Middleware::retry(), for example returning 1000 * 2 ** $attempt milliseconds. Laravel's Http::retry() accepts a sleep value or closure for the same purpose.
- Is guzzlehttp/retry-subscriber maintained or safe for production?
- No. The upstream repository is archived and the package is marked deprecated, so there are no security advisories, PHP 8.x compatibility fixes, or corrections for Guzzle handler edge cases. Retry logic is correctness-sensitive, especially for non-idempotent requests and consumed request bodies. Using an archived dependency in an HTTP retry path is a supply-chain and correctness liability.
- How do I migrate from guzzlehttp/retry-subscriber to Middleware::retry?
- First isolate your retry policy behind an internal interface so the transport is swappable. Then replace the subscriber with a Guzzle HandlerStack that includes Middleware::retry() and a delay callable, or use Http::retry() in Laravel. Finally remove the guzzle/guzzle dependency and add a CI check that composer why guzzle/guzzle stays empty.
- What are alternatives to guzzlehttp/retry-subscriber?
- Use GuzzleHttp\Middleware::retry() with a HandlerStack for raw Guzzle 7, or Laravel's Http::retry() for application HTTP calls. Both provide retry limits, custom delay callables, and conditional retry via a when closure or decider. These are maintained first-party options and avoid the deprecated Guzzle 4/5 dependency.