Menu

Laravel HTTP Client Retry: Retry the Network, Never the Verdict
📰

Laravel HTTP Client Retry: Retry the Network, Never the Verdict

DEV Community: php·Abdulahmed Abdulhakeem·3 days ago
#97qwkxlz
#devto#dev#service#retry#timeout
Reading 0:00
15s threshold

TrustScreen is a KYC document-fraud pre-screen I built. A Laravel 13 app receives batches of up to 10 ID documents or selfies, sends each one to a Python forensics microservice, and turns the per-layer scores that come back into a risk score and a recommendation. The service measures; Laravel decides.

That split puts one HTTP call at the centre of every verification. And the most dangerous line in that call isn't the URL or the payload. It's ->retry() .

Retries feel like free reliability. Add ->retry(3, 100) and transient failures go away. But a retry is a claim: "if I ask again, the answer might be different." For some failures that's true. For others it's false, and acting on it costs money, time and, in a fraud tool, the honesty of the result.

Here's how I decided which failures get retried, who retries them, and why the caller's timeout sits above the service's own.

Two kinds of failure

When Laravel calls the forensics service, a request can fail in two very different ways.

The network failed.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.