EcsElixirCore.Domain.Shared.Common.Model.MessageId (ecs_elixir_core v1.0.0)

Copy Markdown

Normalizes the message-id field from any known key variant.

Single source of truth for message-id extraction and normalization across the library. Accepts any capitalization: "message-id", "messageId", "messageid", "message_id", etc.

Summary

Functions

Extracts the message-id from a map trying all known key variants. Returns nil if not found.

Extracts the message-id or generates a UUID if not found.

Functions

extract(map)

@spec extract(map()) :: String.t() | nil

Extracts the message-id from a map trying all known key variants. Returns nil if not found.

extract_or_generate(map)

@spec extract_or_generate(map()) :: String.t()

Extracts the message-id or generates a UUID if not found.