Message Structure
All messages have a consistent structure.
| Message |
|---|
| Header sequencing / metadata / routing |
| Payload user-defined data |
Header
The header is comprised of the following fields:
| Field | Responsibility | Description |
|---|---|---|
sequenceNumber | Platform | The unique sequence number assigned by the Sequencer. This provides the platform ordering for the message. |
sequencerNanoTime | Platform | The timestamp that the message was received by the Sequencer. |
relayNanoTime | Platform | The timestamp that the message was received by the Relay supplying the message to an application. |
messageType | Platform | Indicates how the message was delivered to the application:
|
applicationId | API | The unique identifier of the application that published the message. |
applicationSequenceNumber | API | An application-provided sequence number for the publication, useful for publisher-side ordering, diagnostics and reconciliation. |
publicationNanoTime | API | An application-provided timestamp associated with publishing the data. |
voided | Application | Indicates whether the message should be treated as no longer valid. Voided messages are routed separately and evicted from the cache. |
editable | Application | Indicates whether edit requests can be made for this data. Messages are not editable by default. |
cacheMode | Application | Controls how the message participates in platform caching. Values are CACHE, CACHE_FOREVER and DO_NOT_CACHE, see Message Caching for details. |
payloadSchemaId | Application | Identifies the schema or model namespace of the payload. It tells subscribers which schema family the payload belongs to, but not the specific message type inside that schema. This field is automatically set by the API when using SBE, DTO, Flexible and Custom serialization. |
payloadTemplateId | Application | Identifies the concrete type within a schema. This field is automatically set by the API when using SBE, DTO, Flexible and Custom serialization. Subscribers use the (payloadSchemaId, payloadTemplateId) tuple to select the correct decoder. |
topicSource | Application | The Topic Source. See Topic Structure. |
topicGroup | Application | The Topic Group. See Topic Structure. |
topicId | Application | The Topic Id. See Topic Structure. |
causeSequenceNumber | Application | Optional sequence number of the incoming message that caused this message to be published. This is useful for cause-and-effect tracking. |
payloadSchemaId and payloadTemplateId are used together to identify the payload type. This is the Type component described in Topic Structure and allows subscribers and tooling to select the correct schema, decoder or payload handler.