Search code examples
javamultithreadingresteasy

Is ResteasyClient threadsafe?


I want to avoid creating a new org.jboss.resteasy.client.jaxrs.ResteasyClient 3.0.9when my Service method gets called; so I want to set it as member variable in the Service class. Therefore, I'd want to know if ResteasyClient threadsafe.


Solution

  • No. By default, the ResteasyClient is not thread safe because of its underlying HTTP dependencies. RESTEasy Client Proxy Overhead? has a way to create a client in a threadsafe way.