Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jersey-dev] How To Use Jersey Client Efficiently

Hi,

There was this article from 2015 by Jakub Podlesak called How To Use
Jersey Client Efficiently.
It's gone from the Oracle site but can be found on the Wayback Machine:
https://web.archive.org/web/20210420010938/https://blogs.oracle.com/japod/how-to-use-jersey-client-efficiently

It says this about the 2.x Client API:
"Be careful when touching configuration of a web target!. What does it
mean? Whenever you create a new web target with updated configuration,
Jersey will effectively create a new client runtime. To keep your
application performing well, you should think of reusing all such web
targets."

Is this still the case using Jersey 3.x? Or is it fine to register
features directly on WebTargets?

Currently I am reusing the same Client instance to access multiple
different APIs.
However those APIs may require different features, e.g.
HttpAuthenticationFeature.
What is the standard solution here - use a Client per API or just
register the features on WebTarget? Maybe behind the scenes it's
effectively the same?

Thanks.

Martynas
atomgraph.com


Back to the top