Hi John,
I would probably use CDI over using a ThreadLocal. That said, I did a
little testing with using a client in a new thread and did not have any
issues in EAP 7.3.8. The Client itself should be thread-safe. The question
would be more is the context setup correctly.
For CDI here's what I've done upstream for RESTEasy 6.1 to allow a client
to be injected. It should work for Jakarta EE 8 too.
https://github.com/resteasy/resteasy/blob/bd243c393e88481b797fb4371c18a44...
On Sun, May 8, 2022 at 7:25 AM John Ulrik <ujay68(a)gmail.com> wrote:
Thanks, James. Currently running in JBoss EAP 7.3.10, among others
(not my
choice to make, actually), but this is a more general question. Sounds like
I should make a ThreadLocal of Clients to be safe. Also this is not about
universal, formal thread-safety but whether I can use a once-initialized
Client instance, with no configuration changes made further on, in more
than one thread concurrently (typically servlet request threads of the
container).
_______________________________________________
resteasy mailing list -- resteasy(a)lists.jboss.org
To unsubscribe send an email to resteasy-leave(a)lists.jboss.org
--
James R. Perkins
JBoss by Red Hat