129 {
130 if (topic.empty()) {
132 LOG(INFO) << "MQTT Broker: Retained Topic found:";
135 LOG(DEBUG) <<
"MQTT Broker: QoS: " <<
static_cast<uint16_t
>(
message.
getQoS());
136 LOG(DEBUG) << "MQTT Broker: Client:";
137 LOG(DEBUG) << "MQTT Broker: QoS: " << static_cast<uint16_t>(qoS);
138
139 LOG(INFO) << "MQTT Broker: Distributing message ...";
141 LOG(INFO) << "MQTT Broker: ... distributing message completed";
142 }
143 } else {
144 const std::string topicLevel = topic.substr(0, topic.find('/'));
145
146 topic.erase(0, topicLevel.size() + 1);
147
150 foundNode->second.appear(clientId, topic, qoS);
151 } else if (topicLevel == "+") {
153 topicTree.appear(clientId, topic, qoS);
154 }
155 } else if (topicLevel == "#") {
157 }
158 }
159 }
static std::string toHexString(const std::vector< char > &data)
void sendPublish(const std::string &clientId, Message &message, uint8_t qoS, bool retain)
const std::string & getTopic() const
const std::string & getMessage() const
void appear(const std::string &clientId, std::string topic, uint8_t qoS)
std::map< std::string, TopicLevel > subTopicLevels