MessageData

MessageData is the raw, low-level storage representation of a message.

Before a message can be written to the message store, it's transformed into a MessageData. When a message is retrieved from the message store, it's retrieved as a MessageData object and then transformed to a message.

It's important to note that in typical use of message objects the applicative code may never be directly exposed to MessageData instances.

The attributes of MessageData objects directly reflect the structure of the underlying storage schema

MessageStore::MessageData Module

There are two implementations of MessageData: MessageStore::MessageData::Write that is the form that can be written to the message store, and MessageStore::MessageData::Read that is the form that is retrieved from the message store.

The MessageStore::MessageData module is the generalized implementation that is common to both specific implementations. Both the MessageStore::MessageData::Write class and the MessageStore::MessageData::Read class include the MessageStore::MessageData module.

MessageData::Read Class

The MessageStore::MessageData::Read class is the implementation of the MessageStore::MessageData module that is the result of reading a message from the message store.

Attributes

NameDescriptionType
idThe message ID. Message IDs are UUIDs.String
typeThe message type. Corresponds to a message's class name.String
dataThe message's business dataHash
metadataThe message's mechanical and infrastructural data, separate from the business dataHash
stream_nameName of the stream where the message was writtenString
positionThe ordinal position of the message in its streamInteger
global_positionThe ordinal position of the message in the entire message storeInteger
timeTimestamp when the message was writtenTime

MessageData::Write Class

The MessageStore::MessageData::Write class is the implementation of the MessageStore::MessageData module that is used to write a message to the message store.

The Write implementation of MessageData inevitably has fewer attributes than the Read implementation because some of a persisted message's attributes are not known until the message data is written to the store.

Attributes

NameDescriptionType
idThe message ID. Message IDs are UUIDs.String
typeThe message type. Corresponds to a message's class name.String
dataThe message's business dataHash
metadataThe message's mechanical and infrastructural data, separate from the business dataHash