Digital Content Component (DCC) Message Protocol

Topic Structure and Wildcards

The wildcards standard is based in the MQTT 3.1.1, as specified in the document: MQTT Version 3.1.1, Section 4.7.1 Topic wildcards.

Extra information is based on: The HiveMQ Team. MQTT Essentials Part 5: MQTT Topics & Best Practices. February 9, 2015. online: https://www.hivemq.com/blog/mqtt-essentials-part-5-mqtt-topics-best-practices/.

Topic Name Structure

Whenever a message is published or subscribed a Topic Name is specified. It is a hierarchical structure composed by one or more Topic Levels separated by slashes / (the Topic Level Separators).

Best Practices

The following best practices have been adopted in the Harena project and must be followed by all developers. They are derived from MQTT Essentials Part 5: MQTT Topics & Best Practices.

Topic Filters and Wildcards

In the subscription process, it is possible to specify a specific Topic Name or a Topic Filter, which works as a regular expression representing a set of possible Topic Names.

Wildcards are represented by the special # and/or + characters, appearing inside a Topic Name in the subscription process. They enable the subscription of a set of topics, since they generically represent one or more Topic Levels, according to the following rules:

Multilevel Wildcard #

The wildcard # can be used only in two positions in the Topic Filter:

Single Level Wildcard +

Only a single Topic Level can be matched by the wildcard +, which represents any possible complete Topic Level Label. The + wildcard can appear only in four positions: