Just a second...

Slave topics

A special type of topic that has no state of its own but is a reference to the state of another topic.

A slave topic acts as an alias to another topic, the master topic. Updates published to the master are fanned out to subscribers of the slave. The slave cannot be updated directly. The master topic must be one of the following types of topic:
  • JSON
  • Binary
  • Single value
  • Record

The link between a slave topic and a master topic is defined when the slave topic is created. This is different to routing topics where the link between topics is defined when a client subscribes.

Why use a slave topic?

You can use slave topics to provide the same data from multiple topic paths and manage the topics from only one topic.

You can use a slave topic to act as a redirection to a succession of master topics. For example, you can create a slave topic called latest that is linked to a master topic where data is published about a current event. When that event is no longer current, you can remove the slave topic and recreate it now linked to the master topic where data is published about what is now the current event.

The subscribing clients can subscribe to the latest slave topic and they continue to be subscribed to the slave topic and receive the latest data, even as the master topic that provides the data changes.

Considerations when using a slave topic

A client only needs permissions on the slave topic. Permission to subscribe to the linked topic is not required.

More than one slave can point to the same master topic.

A slave topic cannot also act as a master topic to another slave topic.

Removing a master topic causes all linked slave topics to be removed.

When using multi-datacenter topic replication to replicate slave topics in the R/ branch of the topic tree, be aware that if the master topic that the slave topic refers to is not in the replicated branch of the topic tree, the slave topic is put in a pending set. The slave topic is not present on the recovered service until the master topic is re-created, at which point the slave topic is automatically created on the recovered service.

When using automatic fan-out to propagate topics from a primary server to one or more secondary servers, be aware that the order of topic creation on the secondary server can prevent slave topics from being replicated. For example, if a slave topic refers to a topic that does not yet exist because it is in a branch not yet replicated or because it is lower down the link hierarchy.