I am trying to connect to a website ABC.com ( HTTP API endpoint). However , due to some problem in the website's end I am not getting a response.
val httpclient: CloseableHttpClient = HttpClients.custom()
.setSSLSocketFactory(sslsf)
.build()
val getSlowQueryRequest: HttpGet = new HttpGet(mySQLHost + "cgi-bin/" + slowQueryLink)
val slowQueryResponse: CloseableHttpResponse = httpclient.execute(getSlowQueryRequest)
The program gets stuck after httpclient.execute() . I tried manually opening the website and even then it was not giving any response. Because of this , the rest of the program gets hung up! Is there some way I can set up some timer to wait for sometime and in case I do not get a response , move on after skipping the test?
EDIT:
Also could it be because of using SSL? Does CloseableHttpClient not provide any default timeout value?
Thanks in advance!