jakartaee / jakartaee/cdi

CDI context propagation

Open
#474 17 comments 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
240
Forks
83
PR merge metrics
No merged PRs in 30d

Description

In CDI spec, the context propagation was not addressed in the spec. The original ticket was raised:

> Key: CDI-587
> URL: https://issues.jboss.org/browse/CDI-587
> Project: CDI Specification Issues
> Issue Type: Epic
> Components: Contexts
> Affects Versions: 1.2.Final
> Reporter: Romain Manni-Bucau
>
> The overall idea is to ensure that it is not cause the code becomes asynchronous/reactive/... that we loose the instances or get another context.
> An example is starting an AsyncContext in a servlet.
> One proposal is to add a flag to ask for propagation of the context in async managed threads: @RequestScoped(inherited = true) which would reuse the same instances for these "new" threads.
> Note however this issue is not only bound to servlets even if it is the easiest example.
> The original thread disucssion on the list: http://cdi-development-mailing-list.1064426.n5.nabble.com/RequestScope-Life-Cycle-td5712701.html

In MicroProfile Context Propagation, some effort was made to address the context propagation and the implementation was made in Weld. However, it has a some issues, such as https://github.com/eclipse/microprofile-context-propagation/issues/167

Contributor guide

Open the contributing guide

Research direction

Start by reading the CDI-587 context-propagation proposal and the linked mailing-list discussion. Then compare the MicroProfile Context Propagation work, the Weld implementation, and issue 167. Done would require a concrete, agreed approach for addressing context propagation in the CDI specification.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
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.