kubeedge / examples

Examples for KubeEdge
Apache License 2.0
246 stars 171 forks source link

who send mqtt message to topic #112

Open yuexian1234 opened 2 years ago

yuexian1234 commented 2 years ago

i find the cloud app code is just update the device status, and the edge app just subcribe the mqtt topic. i want to know,who send message to mq topic? kubeedge controller or cloudapp self. thanks

RyanZhaoXB commented 2 years ago

hello. the cloud app updates the device status to kube-apiserver and the module of device controller in cloudcore will watch the modification and send it to the edgecore through cloudhub. the module of devicetwin in edgecore will rebuild the message and send it to the mq topic through event bus.

yuexian1234 commented 2 years ago

hello. the cloud app updates the device status to kube-apiserver and the module of device controller in cloudcore will watch the modification and send it to the edgecore through cloudhub. the module of devicetwin in edgecore will rebuild the message and send it to the mq topic through event bus.

thanks but how the edgecore known which topic to send?

RyanZhaoXB commented 2 years ago

hello. the cloud app updates the device status to kube-apiserver and the module of device controller in cloudcore will watch the modification and send it to the edgecore through cloudhub. the module of devicetwin in edgecore will rebuild the message and send it to the mq topic through event bus.

thanks but how the edgecore known which topic to send?

we make it in the code of edgecore and mapper. every mapper on this node subscribes these topics to receive the messages and the mapper will check the device id to determine whether the message should be handled by itself.