I am trying to display all inventories but the timeout error keeps showing.
Here is a snippet of the code, and I am running this via groovy script runner
try
{
int TENSECONDS = 10*1000
int THIRTYSECONDS =30*1000
HttpClient httpClient = HttpClientBuilder.create().build()
HTTPBuilder builder = new HTTPBuilder()
builder.getClient().getParams().setParameter("http.connection.timeout", new Integer(THIRTYSECONDS))
builder.getClient().getParams().setParameter("http.socket.timeout", new Integer(THIRTYSECONDS))
HttpGet request = new HttpGet(addr)
request.setHeader("Authorization", "Basic ${authString}")
request.addHeader("content-type", "application/json")
response = httpClient.execute(request)
return response
}
If i test and see at what part it runs, if I put a return request, then it works.
I believe the error comes from "response = httpClient.execute(request)" it just doesnt work. And after it runs, it shows "Error timeout, no stack trace available"
Any help? and also some sites where I can get tutorials?