Skip to content

JobContextModule

Defined in: packages/nestjs/src/job-context.ts:70

Lets the jobs a request enqueues carry its tenant, correlation id and principal (withJobContext), and restores them in processors (@InJobContext()): registers the application’s job principal, tenants and context sources with @cqrs-ddd/pipeline-job-context when the module starts, and unregisters them on shutdown.

@Module({
imports: [
JobContextModule.forRoot({
imports: [AuthsModule],
principal: SessionJobPrincipal,
tenants: () => persistenceConfig().tenants,
sources: { tenantId: tenantSource, correlationId: correlationSource },
}),
],
})
export class AppModule {}

new JobContextModule(): JobContextModule

JobContextModule

static forRoot(options): DynamicModule

Defined in: packages/nestjs/src/job-context.ts:71

JobContextModuleOptions

DynamicModule