Return-Path: X-Original-To: apmail-cxf-users-archive@www.apache.org Delivered-To: apmail-cxf-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5BC3118DDF for ; Thu, 16 Jul 2015 06:34:22 +0000 (UTC) Received: (qmail 90383 invoked by uid 500); 16 Jul 2015 06:34:16 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 90309 invoked by uid 500); 16 Jul 2015 06:34:16 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 90295 invoked by uid 99); 16 Jul 2015 06:34:16 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Jul 2015 06:34:16 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 2D70E1A7044 for ; Thu, 16 Jul 2015 06:34:16 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.1 X-Spam-Level: X-Spam-Status: No, score=-0.1 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id dZBZ4mmDbY8G for ; Thu, 16 Jul 2015 06:34:03 +0000 (UTC) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com [209.85.215.42]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 2B2F543E3E for ; Thu, 16 Jul 2015 06:34:03 +0000 (UTC) Received: by lagx9 with SMTP id x9so37599615lag.1 for ; Wed, 15 Jul 2015 23:33:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=d/++Ooc9ttqVXqm+CHw5xsgtqPfNF3Dd24chikifTKo=; b=zGBHP59T/qUaNkIQwnAJtN2/qoIHaZtu0y52yInseSLITyTNfrUGhmPV+vuupxXCGT HcBkvdb5MMREjvy0BowtF6CBFlT83qda/pvcgAiZGu2OqbFTWsPCiv06IOkIjmgFRBRm 7ZStJ6vL+E9OcJvjsFVDxgKazd/CElMYYbPt/y08KpzPhJa+L/krne0NiNeAExEZMNeN K+pRJ0eLkpkh1NvMud9mv9r+sqdG3LXVW638fZrIve7QUk+iqzt6pDRqK8EBpFKjyYQc TmVYYPL27lpUKRcwq6k7TZPUcYeYE7vGeJFmw4RKxBqnNHG9FpgjeNn0ZLZZ31JeahOQ Psvw== X-Received: by 10.152.225.164 with SMTP id rl4mr7823372lac.38.1437028397084; Wed, 15 Jul 2015 23:33:17 -0700 (PDT) Received: from [10.39.0.31] ([87.252.227.91]) by smtp.googlemail.com with ESMTPSA id kv1sm1767157lbb.48.2015.07.15.23.33.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Jul 2015 23:33:16 -0700 (PDT) Message-ID: <55A7502C.1040906@gmail.com> Date: Thu, 16 Jul 2015 09:33:16 +0300 From: Sergey Beryozkin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: users@cxf.apache.org Subject: Re: Header propagation between chained REST calls References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hi On 16/07/15 04:23, Canning, Charles wrote: > Hi, > > Problem: > > I want to be able to pass a custom header from external client into a REST container call and propagate it with all client REST requests from the container. > > Browser —> RestEndpoint —> Another RestEndpoint. > > > I am going through the JAX-RS 2 specification and there are ContainerRequestFilters and ClientRequestFilters and corresponding xxxContext objects but can’t seem to find a shared context. Does CXF have a shared context to allow this or do I have to look into something like ThreadLocal? Or is there a better approach available with CXF? > have @Context HttpHeaders httpHeaders; and call: https://jax-rs-spec.java.net/nonav/2.0-rev-a/apidocs/javax/ws/rs/core/HttpHeaders.html#getRequestHeaders%28%29 Next pass this map to https://jax-rs-spec.java.net/nonav/2.0-rev-a/apidocs/javax/ws/rs/client/Invocation.Builder.html#headers(javax.ws.rs.core.MultivaluedMap) This builder is returned when one of WebTarget's request() methods is called... Cheers, Sergey > Thanks, > chuck >