Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jersey-dev] [External] : How To Use Jersey Client Efficiently
  • From: Jan Supol <jan.supol@xxxxxxxxxx>
  • Date: Tue, 6 Jan 2026 11:09:45 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=d0LA2h4N2GFjScKKEBFmjLJIbooAM/iWsbLVIHsw4+o=; b=I8+X+KQp/aa+vXilS8YC+NmA+C+jGW9OLYWPz5I1Vx6s9dkUBBJypRHiXxWgKqzuwerlKF2q83pWm7IEF3yx/3IFZo1o172eXxXVTZRo9Zy/Tdml+TYUEg71U7Bpg6tWbWkxbvzctMfaTLlW+85uM+HcajoLSry875E7fVoyjfAZMuCCUrmATRSJNdEE/02l0k760jW1mvRtAv42Nwz66EG/Hk0GZiwqXrl1RNG5JFNY9hMhHqzK1DkA85v1vIsDV9sY2qH4CrhbLf9ZJ5kQNPNAST9xSyuh9p1ax5UHt9C1R+jWGJYQrl446k+8C8FQoAJzREE6MLBJ7hYyi5u5wQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=zPJ8KK8v8qZBn850ouAeaNDz2AOU/Osyckyax1l/gEB1aL+rN3drG9uLZAicvhKZz/a1RrFo3G6d7L256YmAR09pPQK39oPmYKUcW0GBNQyhxLPkYNgGJmix1mfT1RoHEeXb3xn6u+H++jE6Z0tSaPZ/TK8P2CXprfADiWpuDU/pmuuH2vfMgBZ8KtaqAc5azBNeLvtKqgozqCL9ZOb5sr+0GNktOvMcc9zmfFOJOXKtfEXJgSXXeq/cOyuDNZviyk0sP7mLP1fWyyCPbvXWVHqBUqJ1/+SHpcK0mim+yNZbBnVH5J+2RkK0/eIvO0o7vrnOdtj5/J+xzstEZwLQTw==
  • Delivered-to: jersey-dev@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/jersey-dev/>
  • List-help: <mailto:jersey-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/jersey-dev>, <mailto:jersey-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/jersey-dev>, <mailto:jersey-dev-request@eclipse.org?subject=unsubscribe>
  • Msip_labels: MSIP_Label_f3e58186-1c1b-4537-900b-8707ad116850_Enabled=True; MSIP_Label_f3e58186-1c1b-4537-900b-8707ad116850_SiteId=4e2c6054-71cb-48f1-bd6c-3a9705aca71b; MSIP_Label_f3e58186-1c1b-4537-900b-8707ad116850_SetDate=2026-01-06T11:09:45.218Z; MSIP_Label_f3e58186-1c1b-4537-900b-8707ad116850_Name=Internal; MSIP_Label_f3e58186-1c1b-4537-900b-8707ad116850_ContentBits=1; MSIP_Label_f3e58186-1c1b-4537-900b-8707ad116850_Method=Standard;
  • Thread-index: AQHceDEzf5p0nOCw9kCb5Gtg6/kN4rVCY0i3gAEXBYCAAY7RIw==
  • Thread-topic: [External] : [jersey-dev] How To Use Jersey Client Efficiently

Hi,
Is it an issue to keep multiple clients, one per each service-specific auth needs?
--Jan

Confidential- Oracle Internal

From: Martynas Jusevičius <martynas@xxxxxxxxxxxxx>
Sent: Monday, January 5, 2026 12:20 PM
To: Jan Supol <jan.supol@xxxxxxxxxx>
Cc: jersey developer discussions <jersey-dev@xxxxxxxxxxx>
Subject: Re: [External] : [jersey-dev] How To Use Jersey Client Efficiently
 
Thanks Jan, good to know.

How do you recommend implementing these seemingly conflicting requirements then?
- reusing Client instances
- supplying service-specific auth credentials to different services

Martynas

On Sun, Jan 4, 2026 at 7:52 PM Jan Supol <jan.supol@xxxxxxxxxx> wrote:
>
> Hi Martynas,
> Yes, this is still the same. When a WebTarget instance gets initialized - before the request, a costly injection framework (HK2) instance is created. Each feature is registered into the injection framework and to ensure the separation of features between the WebTarget instances, a new WebTarget needs a new injection framework instance. That's where the time is spent.
> HTH,
> Jan
>
> Confidential- Oracle Internal
> ________________________________
> From: jersey-dev <jersey-dev-bounces@xxxxxxxxxxx> on behalf of Martynas Jusevičius via jersey-dev <jersey-dev@xxxxxxxxxxx>
> Sent: Sunday, December 28, 2025 8:35 PM
> To: jersey developer discussions <jersey-dev@xxxxxxxxxxx>
> Cc: Martynas Jusevičius <martynas@xxxxxxxxxxxxx>
> Subject: [External] : [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://urldefense.com/v3/__https://web.archive.org/web/20210420010938/https:/*blogs.oracle.com/japod/how-to-use-jersey-client-efficiently__;Lw!!ACWV5N9M2RV99hQ!IL5I1_uKkYpaJ5ory5lAu-oSbdP02kJBwE6QTWJ7afqzdKSXIZkdvhTT-Um2fTZ0am93fi3_axsS7EovaW3Ptg$
>
> 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
> _______________________________________________
> jersey-dev mailing list
> jersey-dev@xxxxxxxxxxx
> To unsubscribe from this list, visit https://urldefense.com/v3/__https://www.eclipse.org/mailman/listinfo/jersey-dev__;!!ACWV5N9M2RV99hQ!IL5I1_uKkYpaJ5ory5lAu-oSbdP02kJBwE6QTWJ7afqzdKSXIZkdvhTT-Um2fTZ0am93fi3_axsS7Eqvo1uGYA$

Back to the top