Message concepts

Messages contain the data that a client is communicating, such as the contents of a chat message. Clients publish messages on channels, and these messages are received by clients that have subscribed to them. This pattern is otherwise known as pub/sub, as publishers and subscribers are completely decoupled.

The following are the properties of a message:

name
The name of the message.
data
The contents of the message. Also known as the message payload.
id
Each message sent through Ably is assigned a unique ID. Update this ID if you are using idempotent publishing.
clientId
The ID of the client that published the message.
connectionId
The ID of the connection used to publish the message.
timestamp
The timestamp of when the message was received by Ably, as milliseconds since the Unix epoch.
extras
A JSON object of arbitrary key-value pairs that may contain metadata, and/or ancillary payloads. Valid payloads include those related to Push Notifications, deltas and and headers.
encoding
This is typically empty, as all messages received from Ably are automatically decoded client-side using this value. However, if the message encoding cannot be processed, this attribute contains the remaining transformations not applied to the data payload.
Message properties
v2.0