Channel Rules and Namespaces
Apps can have one or more channel rules with configurable settings that will be applied to matching channels created in the app. If no channel rule is found when a channel is created, the default channel rule for the app is applied.
Channel rules allow settings such as whether messages are persisted or TLS required to be configured. The name in each configured channel rule will match any channel with that name or any channel in that namespace. For example, a channel rule with the configured namespace of “rss” will match the channel name “rss” as well as the channel name “rss:news” which is a channel within the “rss” namespace.
Each channel rule has the following configurable settings:
- Persisted messages – If enabled, all messages within this namespace will be persisted. You can access stored messages via the History API. The number of hours a message is stored is configurable, find out more about message persistence
- Require authentication – if enabled, only authorized clients with a clientId will be permitted to subscribe to matching channels. Anonymous clients will not be permitted to join the channel.
- Require TLS – if enabled, only clients who have connected to Ably over TLS will be allowed to join the matching channel.