MicroProfile® Context Propagation 1.0
Primary tabs
MicroProfile Context Propagation includes two core API interfaces.
- ManagedExecutor - an ExecutorService which runs tasks under the context of the submitting thread (like the Java EE/Jakarta EE ManagedExecutorService) and creates managed CompletableFutures which are backed by the ManagedExecutor and where all dependent actions run under the context of the thread that creates the dependent stage.
- ThreadContext - a utility that wraps context around core functional interfaces (such as Function, Supplier, Runnable) which can be used in combination any CompletableFuture, to ensure that actions run with context that is captured from the thread which requests the contextualization.
Both of the above provide a fluent builder pattern for the configuration and creation of new instances, allowing the user to more granularly customize how thread context propagation and clearing is done.
MicroProfile Context Propagation also includes an SPI for third-party implementations to plug-in custom providers of thread context, which are then cleared, captured, propagated and restored according to the standard contract defined by ManagedExecutor and ThreadContext for context propagation and clearing.
This is the initial release of MicroProfile Context Propagation.
MicroProfile Context Propagation is designed for full compatibility with (although currently no direct dependencies on) Concurrency Utilitities for Java EE / Jakarta Concurrency.