I have a the below method calling 3rd Party client:
public String fetchName() {
Flowable<Map> response = client.retrieve(HttpRequest.GET(uri)
.header(AUTH, getToken()), Map.class);
return response.blockingFirst().get("Name").toString();
}
The above method is getting called multiple times. When this happens I get the below exception
io.micronaut.http.client.exceptions.ReadTimeoutException: Read Timeout
I have tried the solution in the link: Micronaut ReadTimeoutException
But I still get the exception.
I have also tried the annotation: @ExecuteOn(TaskExecutors.IO)
for the controller method calling the above client method multiple times in case the current thread blocks. This also did not work.
And the exception does not occur always but most of the time. Tried to browse a lot but in vain. Thank you in Advance.