Message properties
The following are the properties of a message:Accessing message properties
When you receive a message, you can access all its properties:Message data types
Thedata property of a message can contain different types of data:
String data
JSON objects
Binary data
Message extras
Theextras field allows you to include additional metadata with your messages:
Push notification extras
When publishing push notifications, use theextras field to include push-specific data:
Message idempotency
You can provide your own message ID to ensure idempotent publishing. If you publish a message with the same ID twice, only one message will be delivered: This is useful for ensuring messages aren’t duplicated during retries or network issues.Message encoding
Ably automatically handles encoding and decoding of messages:- JSON objects are automatically serialized and deserialized
- Binary data is properly encoded
- String data is UTF-8 encoded
encoding property tells you what transformations were applied to the message data. In most cases, this will be empty as the SDK handles decoding automatically.
Message size limits
Messages have the following size limits:- Maximum message size: 65,536 bytes (64 KiB)
- Messages are counted in 5 KiB chunks for billing purposes
Next steps
- Learn how to publish messages
- Learn how to subscribe to messages
- Explore message history
- Understand message delivery tracking
