WithCorrelation
Call Signature
Section titled “Call Signature”WithCorrelation():
DualMethodDecorator
Defined in: decorators/with-correlation.decorator.ts:188
Queue-agnostic MethodDecorator that propagates a correlation ID into the
pipeline’s async-local correlation context.
Place it under any transport or scheduling decorator a framework adds. It does not replace or interfere with them.
It extracts the correlation ID from the method arguments (via path or
extract) and runs the method with it when it is printable ASCII without
surrounding spaces and, once configureCorrelation has been called, passes its
rules. Otherwise the method keeps the current id, or gets a new one from
correlationSource.create(), and a rejected id is reported to onRejected with the
source 'Class.method'.
⚠️ Array payloads:
When using the default dot-path extraction, the first argument must be an
object (e.g. a Bull Job). If it is an array, the dot-path cannot resolve
and the decorator logs a warning at runtime. For transports that
deliver an array as the first argument, use the extract option:
Inside the method body, read the active ID with:
Returns
Section titled “Returns”DualMethodDecorator
Example
Section titled “Example”Call Signature
Section titled “Call Signature”WithCorrelation(
path):DualMethodDecorator
Defined in: decorators/with-correlation.decorator.ts:189
Queue-agnostic MethodDecorator that propagates a correlation ID into the
pipeline’s async-local correlation context.
Place it under any transport or scheduling decorator a framework adds. It does not replace or interfere with them.
It extracts the correlation ID from the method arguments (via path or
extract) and runs the method with it when it is printable ASCII without
surrounding spaces and, once configureCorrelation has been called, passes its
rules. Otherwise the method keeps the current id, or gets a new one from
correlationSource.create(), and a rejected id is reported to onRejected with the
source 'Class.method'.
⚠️ Array payloads:
When using the default dot-path extraction, the first argument must be an
object (e.g. a Bull Job). If it is an array, the dot-path cannot resolve
and the decorator logs a warning at runtime. For transports that
deliver an array as the first argument, use the extract option:
Inside the method body, read the active ID with:
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”DualMethodDecorator
Example
Section titled “Example”Call Signature
Section titled “Call Signature”WithCorrelation(
options):DualMethodDecorator
Defined in: decorators/with-correlation.decorator.ts:190
Queue-agnostic MethodDecorator that propagates a correlation ID into the
pipeline’s async-local correlation context.
Place it under any transport or scheduling decorator a framework adds. It does not replace or interfere with them.
It extracts the correlation ID from the method arguments (via path or
extract) and runs the method with it when it is printable ASCII without
surrounding spaces and, once configureCorrelation has been called, passes its
rules. Otherwise the method keeps the current id, or gets a new one from
correlationSource.create(), and a rejected id is reported to onRejected with the
source 'Class.method'.
⚠️ Array payloads:
When using the default dot-path extraction, the first argument must be an
object (e.g. a Bull Job). If it is an array, the dot-path cannot resolve
and the decorator logs a warning at runtime. For transports that
deliver an array as the first argument, use the extract option:
Inside the method body, read the active ID with:
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”DualMethodDecorator