IntegrationsNestJSReference
KubeMQCqrsOptions
Full field reference for KubeMQCqrsModule.forRoot() options that route NestJS CQRS commands, queries, and events through KubeMQ.
Every field accepted by KubeMQCqrsModule.forRoot() when wiring up the CQRS bridge.
Configuration Options
KubeMQCqrsModule.forRoot() accepts KubeMQCqrsOptions. All fields are optional and have sensible defaults.
| Parameter | Type | Default | Description |
|---|---|---|---|
commandChannelPrefix | string | 'cqrs.commands' | Channel prefix for commands; the full channel is {prefix}.{CommandName}. |
queryChannelPrefix | string | 'cqrs.queries' | Channel prefix for queries. |
eventChannelPrefix | string | 'cqrs.events' | Channel prefix for events. |
persistEvents | boolean | false | Publish events to the durable Events Store (sendEventStore) instead of fire-and-forget Events (sendEvent). |
commandTimeout | number | 10 | Command request-reply timeout (seconds). |
queryTimeout | number | 10 | Query request-reply timeout (seconds). |
drainTimeoutSeconds | number | 5 | Time to drain in-flight messages when the module is destroyed (seconds). |
channelResolver | (message: object) => string | message.constructor.name | Maps a message instance to its channel segment (the part after the prefix). |
serializer | KubeMQSerializer | JsonSerializer | Outbound message serializer. |
deserializer | KubeMQDeserializer | JsonDeserializer | Inbound response deserializer. |
For async configuration (for example, pulling prefixes from ConfigService), use KubeMQCqrsModule.forRootAsync({ imports, useFactory, inject }), which returns the same providers via a factory.
Related
Was this page helpful?