NamedMessage

A message that has both a name and is associated with a bounded context.

This interface combines the capabilities of NamedBoundedContextMessage and Named, providing messages with identity within a specific bounded context. The name typically represents the message type or command/event name, while the bounded context provides the domain scope.

Parameters

SOURCE

The self-referential type for fluent method chaining

T

The type of the message body payload

See also

for naming capabilities

for bounded context association

Inheritors

Properties

Link copied to clipboard
abstract val body: T

The typed payload of the message.

Link copied to clipboard
abstract val contextName: String

The name of the bounded context this entity belongs to.

Link copied to clipboard
abstract override val createTime: Long

The timestamp when this message was created, as a Unix timestamp in milliseconds.

Link copied to clipboard
abstract val header: Header

The header containing metadata about this message.

Link copied to clipboard
abstract val id: String

Represents a unique identifier for the implementing entity.

Link copied to clipboard

Indicates whether this message is in read-only mode.

Link copied to clipboard
abstract val name: String

The name of the entity.

Functions

Link copied to clipboard

Checks if this entity belongs to the same bounded context as another entity.

Link copied to clipboard
open fun withHeader(additionalSource: Map<String, String>): SOURCE

Adds all key-value pairs from the provided map to the message header and returns the message for method chaining.

open fun withHeader(key: String, value: String): SOURCE

Adds a key-value pair to the message header and returns the message for method chaining.

Link copied to clipboard
open fun withReadOnly(): SOURCE

Marks this message as read-only and returns it for method chaining.