As discussed earlier, a topic is routing information, which is used by the client for publishing and subscribing to messages. Topics are represented by strings and can have one or more levels. Each topic level is separated by a forward slash (/). A topic is created as soon as a client sends data on it, so it is not necessary to create the topic explicitly. Let's understand it with an example. Consider Figure 3.9. We have two Air Conditioners (ACs) at home; one is in the dining room and the other is in the bedroom:
Both the ACs are connected to the broker and we have a mobile application that communicates to the AC using ...