I'm using the RESTClient class from Codehaus (http://groovy.codehaus.org/modules/http-builder/apidocs/index.html?groovyx/net/http/RESTClient.html) in my application, however, I'm running into issues when multiple threads try to use the client at the same time. After some reading I found out that this is because the RESTClient class by default uses a single connection that cannot be shared by multiple threads. The answer seems to be to use a different connection class that allows concurrent use from multiple threads (as mentioned here: Groovy RestClient with many connections). However, I can't seem to find anywhere how to tell the RESTClient class to use these other types of connections. Is this even possible? I'm hoping to keep the advantage of the RESTClient, so using just a generic HTTPBuilder or AsyncHTTPBuilder class instead of the RESTClient sort of defeats the purpose of the RESTClient class (unless it's possible to have the HTTPBuiler/AsyncHTTPBuilder class spit out a RESTClient connection).
Alternatively, should I be just creating a new RESTClient for each thread?
Alternatively, should I be just creating a new RESTClient for each thread?
yes, it's the easiest way