Class: Message
(-- api-linter: core::0146::any=disabled aip.dev/not-precedent: We want runtime extensibility for the body field --)
Implements
Constructors
constructor
• new Message(properties?
): Message
Constructs a new Message.
Parameters
Name | Type | Description |
---|---|---|
properties? | IMessage | Properties to set |
Returns
Properties
body
• Optional
body: null
| IAny
The opaque data carried by this message. The protocol type can be extracted from the package name of the message carried inside the Any.
Implementation of
commandIndex
• Optional
commandIndex: null
| Long
Message commandIndex.
Implementation of
eventId
• Optional
eventId: null
| Long
Message eventId.
Implementation of
id
• id: string
An ID for this specific message.
Implementation of
protocolInstanceId
• protocolInstanceId: string
Identifies the specific instance of a protocol to which this message belongs.
Implementation of
sequencingId
• Optional
sequencingId: "eventId"
| "commandIndex"
The event ID or command ID after which this message can be delivered. The effects of history up to and including this event ID should be visible to the code that handles this message. Omit to opt out of sequencing.
Methods
toJSON
▸ toJSON(): Object
Converts this Message to JSON.
Returns
Object
JSON object
create
▸ create(properties?
): Message
Creates a new Message instance using the specified properties.
Parameters
Name | Type | Description |
---|---|---|
properties? | IMessage | Properties to set |
Returns
Message instance
decode
▸ decode(reader
, length?
): Message
Decodes a Message message from the specified reader or buffer.
Parameters
Name | Type | Description |
---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
length? | number | Message length if known beforehand |