feat(mqtt): peer-namespaced talker topics
External (peer-side) talker events move from flat talker/<tg>/start with is_trunk=true to peer/<peer_id>/talker/<tg>/start. Local-only talker/<tg>/start retains today's behavior. To carry peer_id through the signal path: add peer_id as a 4th argument to TGHandler::trunkTalkerUpdated; reorder clearTrunkTalkerForTG / clearTrunkTalkersForPeer / clearAllTrunkTalkers so the signal fires before m_trunk_talker_peer_ids is erased; pre-populate m_trunk_talker_peer_ids in setTrunkTalkerForTGViaPeer before calling the inner setter; switch TrunkLink::handleMsgPeerTalkerStart from setTrunkTalkerForTG to setTrunkTalkerForTGViaPeer. Reasons: dashboards subscribing across the mesh can now use peer/+/talker/+/start to enumerate peer talkers without parsing the is_trunk payload flag, and the namespacing aligns with the new peer/<peer_id>/client/<call>/* topics added in Tasks 5-6.
This commit is contained in:
1 parent
81672bae23
commit
af746d7534
8 files changed
+105
-34
No files matched your search
@@ -2808,7 +2808,8 @@ void Reflector::forwardFlushToSatellitesExcept(SatelliteLink* except,
|
||||
|
||||
|
||||
void Reflector::onTrunkTalkerUpdated(uint32_t tg,
|
||||
std::string old_cs, std::string new_cs)
|
||||
std::string old_cs, std::string new_cs,
|
||||
std::string peer_id)
|
||||
{
|
||||
auto ge_v2_client_filter =
|
||||
ReflectorClient::ProtoVerLargerOrEqualFilter(ProtoVer(2, 0));
|
||||
@@ -2826,7 +2827,7 @@ void Reflector::onTrunkTalkerUpdated(uint32_t tg,
|
||||
ReflectorClient::TgFilter(tg));
|
||||
if (m_mqtt != nullptr)
|
||||
{
|
||||
m_mqtt->onTalkerStop(tg, old_cs, true);
|
||||
m_mqtt->onPeerTalkerStop(peer_id, tg, old_cs);
|
||||
}
|
||||
if (m_redis != nullptr)
|
||||
{
|
||||
@@ -2844,7 +2845,7 @@ void Reflector::onTrunkTalkerUpdated(uint32_t tg,
|
||||
ReflectorClient::TgMonitorFilter(tg))));
|
||||
if (m_mqtt != nullptr)
|
||||
{
|
||||
m_mqtt->onTalkerStart(tg, new_cs, true);
|
||||
m_mqtt->onPeerTalkerStart(peer_id, tg, new_cs);
|
||||
}
|
||||
if (m_redis != nullptr)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user