jakartaee / jakartaee/rest

Context propagation for async client

Open
#668 5 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
400
Forks
143
PR merge metrics
No merged PRs in 30d

Description

A JAX-RS provider can depend on context propagation. This context is propagated betewen threads via thread locals. An example use of such context can be found in tracing integration.

Parent tracing context e.g. one which represents server request has to be available in client filter when creating an outbound request in order to wire them together. At the moment this is typically done by wrapping executor service into something like https://github.com/opentracing-contrib/java-concurrent#configuration. In JAX-RS this is needed because client filter can be invoked in a different thread.

https://github.com/eclipse-ee4j/jaxrs-api/issues/596 introduces SPI to automatically register client features which is great but we still need a reliable way to propagate context to features.

The discussion started in https://github.com/eclipse-ee4j/jaxrs-api/issues/596#issuecomment-424017545

Contributor guide

Open the contributing guide

Research direction

Start by reading JAX-RS issue 596 and its linked discussion, then examine the client filter and automatically registered client feature paths described here. Define how parent tracing context reaches features when an outbound request runs on another thread; the work is done when that propagation is reliable without requiring each caller to wrap its executor service.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.