Answer the question
In order to leave comments, you need to log in
How to contact another url if the main one suddenly became unavailable?
There is a project that uses libraries org.apache.http.*;
. But according to the examples, I can only work with 1 (url) service (API), but what if it does not respond?
How to make a robot with a list of url addresses, so that if the first one does not respond within 3 seconds, send a request to another url and so on until the end of the list?
Answer the question
In order to leave comments, you need to log in
There are no automatic means in your library for this. Implement by hand. Actually, you have already written the algorithm, it remains only to implement it beautifully. Write your own class, pass a list of all URLs as a parameter. In it, outside - the GetResponse method, well, two callbacks - OnResponse, OnError, For example ...
on good, it is necessary to solve the architecture of the backend. failovers, pp dns and more :)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question