How to handle Too Many Requests (429) error in Mule 4 Process API

174 Views Asked by At

I am new to Mulesoft and need help in resolving the Too Many Requests (429) error thrown when I call my Mule System API /Layer from Mule Process API.

My Mule Process API has below mentioned (screenshot) sub flow to call system API. For each record there are 2 calls made based on if the record is found or not found ((get and Put) or (get and Post)). I have 4000 records to loop. The workers and worker size are 1 and 0.2vcores for both system and process and can't be increased.

The Mule System API has a rate limit policy set to 10 transactions per second ( to reflect the rate limit of the external system)

How do I control the number of calls made to the system API to avoid Too Many Requests (429) error.

enter image description here

1

There are 1 best solutions below

1
BassemSalman On

I recently solved this problem by using the "until-successful" scope. Since "429 - Too Many Requests" leads to an exception in Mule 4, the mentioned scope will repeat itself. You can configure how much time to wait before calling again and max retries.