Home:ALL Converter>Program execution stuck on multiple sharepoint api calls

Program execution stuck on multiple sharepoint api calls

Ask Time:2022-12-06T16:04:35         Author:Gopal Gupta

Json Formatter

I am working on sharepoint connector. I used to call multiple apis in multi threaded environment. I am using CloseableHttpClient. When there is 429 throttling I have retried the api call after sleep time for 5 times max until I get 200 ok response. I have a lot of api calls to fetch data related to a file. For example authors, modifiedBy, access control, etc. After some api calls I get 429 response and it retry and give me 200. But in multiple api calls and multiple threads, the program stuck. If I reduce api calls then it works fine. Also in synchronised calls it is working fine. I am in doubt if it is issue with sharepoint backend or with CloseableHttpClient. And what could be the solution. Because I have tried adding Thread.sleep but I got the same issue.

I have tried seperating api calls at different levels of code and passing the response in parameters. It worked till some extent but I have lot of calls and it again got stuck when I increased one more api call in my code. This is working fine for on prem sharepoint but getting stuck in middle in case of online sharepoint.

Author:Gopal Gupta,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/74699140/program-execution-stuck-on-multiple-sharepoint-api-calls
yy