API reference / @node-ts/bus-core / CustomHandler
Interface: CustomHandler<TMessage>
Defined in: packages/bus-core/src/handler/custom-handler.ts:7
A handler that handles messages defined externally to the system, that don't extend from the Message base
Type Parameters
| Type Parameter | Default type |
|---|---|
TMessage | any |
Methods
handle()
ts
handle(
message,
attributes,
context
): unknown;Defined in: packages/bus-core/src/handler/custom-handler.ts:15
Called each time a message that this handler's resolver matches is received
Parameters
| Parameter | Type | Description |
|---|---|---|
message | TMessage | The message read from the bus |
attributes | MessageAttributes | Attributes of the message read from the bus |
context | HandlerContext | Sends, publishes, fails or returns messages through the bus that received the message |
Returns
unknown
Anything. A returned promise is awaited, and the value it resolves to is ignored