CorrelationFrom
constCorrelationFrom:object
Defined in: decorators/with-correlation.decorator.ts:257
Pre-built extraction presets for WithCorrelation, for transports whose handlers receive the correlation id in metadata rather than in the payload.
For transports that carry it in the payload (BullMQ, PostgreSQL NOTIFY), use
the bare @WithCorrelation() or a path; for any other shape, an extract
function.
Type Declaration
Section titled “Type Declaration”
readonlygrpc: (key) =>CorrelationDecoratorOptions
gRPC — extracts from gRPC Metadata (second argument).
In gRPC handlers the signature is (data, metadata, call).
Parameters
Section titled “Parameters”string = DEFAULT_CORRELATION_HEADER
Metadata key. Defaults to 'x-correlation-id'.
Returns
Section titled “Returns”Example
Section titled “Example”class Users { // gRPC (@grpc/grpc-js): (request, metadata) @WithCorrelation(CorrelationFrom.grpc()) async findOne(request: FindOneRequest, metadata: Metadata) {}}