Summary
RabbitMQMessage constructor declares default values via RunMQUtils.generateUUID() for id and correlationId:
constructor(
readonly message: any,
readonly id: string = RunMQUtils.generateUUID(),
readonly correlationId: string = RunMQUtils.generateUUID(),
...
)
In TypeScript, parameter defaults are evaluated lazily (only when the argument is undefined). The consumer hot path always passes both explicitly (RunMQConsumerCreator.ts:62-69), so in practice the defaults don't fire. Just want a confirmation pass to make sure we're not allocating two UUIDs per message somewhere.
Where
src/core/message/RabbitMQMessage.ts:7-14
- All constructor callsites
Action
- Audit every
new RabbitMQMessage(...) call site.
- Confirm
id and correlationId are always explicitly passed in the hot path.
- Optional: drop the defaults if no callers rely on them, to make the contract explicit.
Priority
Low. Diagnostic, not a confirmed bug.
Summary
RabbitMQMessageconstructor declares default values viaRunMQUtils.generateUUID()foridandcorrelationId:In TypeScript, parameter defaults are evaluated lazily (only when the argument is
undefined). The consumer hot path always passes both explicitly (RunMQConsumerCreator.ts:62-69), so in practice the defaults don't fire. Just want a confirmation pass to make sure we're not allocating two UUIDs per message somewhere.Where
src/core/message/RabbitMQMessage.ts:7-14Action
new RabbitMQMessage(...)call site.idandcorrelationIdare always explicitly passed in the hot path.Priority
Low. Diagnostic, not a confirmed bug.