cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <sberyoz...@gmail.com>
Subject Re: Header propagation between chained REST calls
Date Thu, 16 Jul 2015 06:33:16 GMT
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
>


Mime
View raw message