Answer the question
In order to leave comments, you need to log in
How to design API to avoid 504 Gate away error?
Hello, I have an API written in Java Spring boot that takes an .XLSX file as input and parses the data inside the loop into a list of objects.
With each iteration of the loop, using WebClient, it knocks with a parameter on a third-party API from the database and receives some data back. Then it writes all the parsed data to a file and issues it back.
The problem is that, due to large calls to a third-party API, the program takes too long (5-7 minutes) when I run it on prod, I get 504 Gate away.
Question: How can you optimize or intelligently design to avoid the above problem?
There are thoughts to use asynchrony or multithreading, but I'm not sure that this is a solution to the problem.
Please share your wisdom.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question