Hi Hardy,

My expertise is more in the area of the MicroProfile Rest Client (which
uses a lot of code from the CXF proxy client instances), so take my advice
with a grain of salt...

The CXF clients should be thread-safe, so it should be fine to re-use the
same client instance, avoiding the construction and tear-down cost of a new
client instance per-request. Re-using is certainly the most efficient
approach, but you will want to test it out that it works as-expected in
your application.

Hope this helps,

Andy

On Mon, May 27, 2019 at 5:09 AM Hardy Massen <[email protected]>
wrote:

> Hello!
>
> I have an EJB-Stateless-Session-Bean that acts as a Webservice-Client,
> when it is invoked by certain conditions. Runtime is a JBoss EAP 6, which
> uses Apache CXF.
>
> What is the best structure of my ejb-method? Should each EJB-Method-Call
> build a new Apache-CXF-Client-instance? Or is it better to build one
> Apache-CXF-Client per Session-Bean and re-use it on every EJB-Method-call?
>
> Best Regards Hardy
>
> ---
> Handelshof Management GmbH • Viktoriastr.26 • 51149 Koeln (Germany) •
> Amtsgericht Koeln HRB2078 • Ust.-ID-Nr. DE 123064252 • Sitz der
> Gesellschaft: Koeln • Geschaeftsfuehrer: Dipl.-Betriebsw. (BA) Wolfgang
> Baer (MBA) (Sprecher), Dipl.-Betriebsw. (FH) Udo Bernecker, Dr. Wilhelm von
> Moers • www.handelshof.de
>
>
>

Reply via email to