How do I enable history? My messages are not being stored for longer than a few minutes.

History is disabled by default as each message stored and retrieved from history counts as an extra message.

As such, customers must explicitly enable message persistence on the channels they want history to be enabled.

We recommend you read the following to get started:

If you are encountering unexpected results when querying history on a channel, consider the following troubleshooting steps:

  • Have you created a channel namespace rule?
  • When publishing messages are you using an API key or a token derived from an API key from the application associated with the channel namespace rule?
  • When retrieving history are you using an API key or a token derived from an API key from the application where you have created the channel namespace rule?
  • Is the channel name or namespace you are using for both publishing messages and retrieving history covered by the channel namespace rule?

TIP: An Ably API key always begins with the Ably app ID it is associated with. For example, an API key like I2E_JQ.OqUdfg indicates that it belongs to an Ably application with the ID I2E_JQ. You can use this information to verify that you are utilizing a key from the correct application where a message persistence rule has been established.