Skip to content

Interface: InterceptorContext<P, S>

Makaio Framework


Makaio Framework / bus-core / InterceptorContext

Defined in: ../../../packages/bus-core/src/types/interceptor.ts:14

Context provided to interceptor handlers.

Interceptors run BEFORE event handlers (not request handlers), allowing:

  • Payload transformation via replacePayload()
  • Event blocking via stopPropagation()
  • Sequential execution in priority order (highest first)

Note: Interceptors only work with event subjects. For request/response flow interception, use middleware instead.

P

S = string

readonly correlationId: string | undefined

Defined in: ../../../packages/bus-core/src/types/interceptor.ts:18


readonly messageId: string

Defined in: ../../../packages/bus-core/src/types/interceptor.ts:17


readonly payload: P

Defined in: ../../../packages/bus-core/src/types/interceptor.ts:16


readonly subject: S

Defined in: ../../../packages/bus-core/src/types/interceptor.ts:15

next(): void

Defined in: ../../../packages/bus-core/src/types/interceptor.ts:36

Explicitly continue to the next interceptor (optional). Continuation is implicit if neither stopPropagation() nor next() is called.

void


replacePayload(newPayload): void

Defined in: ../../../packages/bus-core/src/types/interceptor.ts:30

Replace the payload with a new value. Subsequent interceptors and handlers will receive the new payload.

P

void


stopPropagation(): void

Defined in: ../../../packages/bus-core/src/types/interceptor.ts:24

Stop propagation of this message. Subsequent interceptors and all handlers will NOT be called.

void