rest client - Groovy RestClient with many connections -
using groovy restclient getting following exception:
java.lang.illegalstateexception: invalid use of basicclientconnmanager: connection still allocated. make sure release connection before allocating one.
as understand 1 connection has not released, cannot make one.
what possible solutions?
make new restclient every call? or maybe there pool?
thanks!
by default rest client uses basicclientconnmanager handles 1 connection @ 1 time. in order concurrent connections, need use asynchttpbuilder:
def httpclient = new asynchttpbuilder( poolsize: 20, uri: 'https://www.mysite.com' )
Comments
Post a Comment