NamedBoundedContextMessage

An extension of the Message interface that incorporates the NamedBoundedContext trait. This interface represents a message that is associated with a bounded context and has a name.

Parameters

SOURCE

The type of the message source, self-referential to allow for fluent API design.

T

The type of the message body.

Inheritors

Properties

Link copied to clipboard
abstract val body: T

The body of the message, containing the actual data payload of the message.

Link copied to clipboard
abstract val contextName: String
Link copied to clipboard
abstract override val createTime: Long

The create time of the message, represented as a Unix timestamp in milliseconds.

Link copied to clipboard
abstract val header: Header

The header of the message, containing metadata about the message.

Link copied to clipboard
abstract val id: String

Represents a unique identifier for the implementing entity.

Link copied to clipboard

Indicates whether the message is read-only, based on the state of the header.

Functions

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

Adds all entries from the provided map to the message header and returns the message itself for method chaining.

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

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

Link copied to clipboard
open fun withReadOnly(): SOURCE

Marks the message as read-only and returns the message itself for method chaining.