MessagePropagator

Interface for message propagators that transfer context information from upstream messages to headers.

Message propagators are responsible for copying relevant context data (like tracing information, user details, etc.) from source messages to target message headers for distributed tracing and context propagation.

The runtime calls the propagators of a MessagePropagators registry: the Spring bean, made of the ServiceLoader contributions and the MessagePropagator beans, or MessagePropagators.DEFAULT outside Spring.

Inheritors

Functions

Link copied to clipboard
abstract fun propagate(header: Header, upstream: Message<*, *>)

Propagates context information from an upstream message to the target header.

open fun propagate(header: Header, upstream: Message<*, *>, producer: FunctionInfo)

Propagates context from upstream to the header of a message that producer creates from it, such as a command a saga function sends for an event. A propagator whose keys belong to one downstream function only (the wait chain) uses producer to decide; the default ignores it.