go语言nsq源码解读九 tcp和http中channel、topic的增删

通过前面多篇文章,nsqlookupd基本已经解读完毕了,不过在关于channel和topic的增删上还比较模糊,所以本篇将站在宏观的角度来总结一下,tcp.go和http.go两个文件中关于channel和topic的操作有哪些。

总结如下表:

模块文件所在方法名调用方法Registration
CategoryKeySubKey
TCPlookup_protocol_v1.goREGISTERAddProducer“channel”topicchannel
AddProducer“topic”topic“”
UNREGISTERRemoveProducer“channel”topicchannel
RemoveProducer“channel”topic“*”
RemoveProducer“topic”topic“”
IDENTIFYAddProducer“client”“”“”
HTTPhttp.gotopicsHandlerFindRegistrations“topic”“*”“”
channelsHandlerFindRegistrations“channel”topicName“*”
lookupHandlerFindRegistrations“channel”topicName“*”
FindRegistrations“topic”topicName“”
createTopicHandlerAddRegistration“topic”topicName“”
deleteTopicHandlerRemoveRegistration“channel”topicName“*”
RemoveRegistration“topic”topicName“”
tombstoneTopicProducerHandlerFindProducers“topic”topicName“”
createChannelHandlerAddRegistration“channel”topicNamechannelName
AddRegistration“topic”topicName“”
deleteChannelHandlerRemoveRegistration“channel”topicNamechannelName
nodesHandlerFindProducers“client”“”“”
LookupRegistrations“topic”“*”“”
FindProducers“topic”t“”

原文地址:https://www.cnblogs.com/zhangboyu/p/7457025.html