Skip to content

Verify RabbitMQMessage default UUID generation is lazy (low priority) #31

@iifawzi

Description

@iifawzi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancePerformance / hot-path issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions