what you need to do is when you make the api request - put that in the queue and even delay it by few seconds..
Dec 27, 2018
8
Level 3
Too Many Concurrent HTTP Requests
I have a platform that sends a large amount of SMS. I may an API request and pass a callback URL which then notifies me of the outcome of the message. If i send 10k text messages over the span of 3 mins, i get bombarded with delivery responses.
Right now when a delivery response comes in, i throw the response in a queue and it gets handled. I believe what is happening is TOO MANY requests are coming in, and I cannot handle all of them.
any suggestions on handling this?
Level 3
since im using the api route, there is a thottle on the API middleware.
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\Laravel\Spark\Http\Middleware\CreateFreshApiToken::class,
],
'api' => [
'throttle:60,1',
'bindings',
],
];
This throttle value was the issue.
1 like
Please or to participate in this conversation.