skip to Main Content

Laravel – How can I retry a pool HTTP request based on certain status codes?

I'm making a set of HTTP requests using Laravel's Http::pool like so: $responses = Http::pool(fn(Pool $pool) => $requests->map(fn($r) => $pool->as($r->id)->myMacro()->post('myUrl', [ ... ]) )); myMacro() is defined in AppServiceProvider like so: PendingRequest::macro('myMacro', function () { return PendingRequest::withHeaders([ 'Content-Type' => 'application/json',…

VIEW QUESTION

Asp.net – Polly Retry with HTTP Client is exceeding the Number of Max Retries and continues Retry till HTTP Timeout Occurred

I have defined some Typed API Client via Dependency Injection in Start up like below. public void ConfigureHttpClients(IServiceCollection services) { services.AddHttpClient<IMyHttpClient,MyHttpClient>() .AddPolicyHandler(GetRetryPolicy(Configuration)); } And Get Retry Policy is defined like this : private static IAsyncPolicy<HttpResponseMessage> GetRetryPolicy(IConfiguration configuration) { int numberOfretries…

VIEW QUESTION
Back To Top
Search