You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First created a Broker A, port 61883,
Then launch a second Broker B, port 11883
Then open a client link Broker A subscribe to Topic up / # and then send the received message to Broker B (remain as is)
Then open a client C link Broker B subscribe Topic up / # and print out the received log
In open a client link Broker A send Topic up / 1...] up / 10000 10000 topics content to 1, set retain retention message, send the second time, restart the Broker B, and then continue to send the latest Topic up / 1...] up / 1000010000 topics, content for 2 set retain retention message
Client C immediately reconnects after C received the data part is the latest content part 2 is the old data 1
The data received by Broker A after opening a client link is up-to-date
The problem may be that after the client below Broker B and Broker B subscribes to Topic up / #, when Broker sends it to the client, Broker receives the latest data, but Broker has not completed yet. He thinks the newly received data has been sent this time, so the client does not receive the latest data
My original requirement was to have a 4-level Broker, which was A1-> B1-> C1-> D1 respectively
Each Broker has a client link to the upper level, sending the data of the Broker to the upper level
But later I found that after you may restart the B1 in the middle, the subject part of the client subscription under B1 can not receive the latest data of the retain message, it is the old data,
Here is an example of my test ConsoleApp51.zip
The text was updated successfully, but these errors were encountered:
首先使用mqttnet 创建了一个 Broker A, 端口 61883 ,
然后又启动第二个 Broker B , 端口 11883
然后开一个客户端链接 Broker A 订阅 Topic up/# 然后讲 收到的消息 发给Broker B (保留原样)
然后在开一个客户端 C 链接 Broker B 订阅 Topic up/# ,并打印出来 收到的日志
在开一个客户端 链接 Broker A 发送 Topic up/1... up/10000 一万个主题 内容为1,设置 retain 保留消息,发送完第二次后,把Broker B 重启,然后继续发送最新的 Topic up/1... up/10000 一万个主题,内容为 2 设置 retain 保留消息
客户端 C 立即重连后 C收到的数据 部分是最新的内容2 部分是旧数据1
单在开一个客户端 链接 Broker A 收到的 收到的数据是最新的
问题可能是在,Broker B, Broker B 下面的客户端订阅 Topic up/# 后,Broker 发送给客户端时,Broker 又收到最新的数据,但是 Broker 发送还没有完成,新收到的数据他认为本次已经发送了,所以导致客户端没收到最新的
我原本的需求是 有4级 Broker,分别是 A1->B1->C1->D1
每个Broker 有一个客户端链接到上一级,把本级Broker的数据发送到上一级
但是后面发现 可能重启 中间的B1 后,B1下面的客户端 订阅的主题 部分收不到retain 消息的最新的数据,是老的数据,
下面是我测试的例子
ConsoleApp51.zip
First created a Broker A, port 61883,
Then launch a second Broker B, port 11883
Then open a client link Broker A subscribe to Topic up / # and then send the received message to Broker B (remain as is)
Then open a client C link Broker B subscribe Topic up / # and print out the received log
In open a client link Broker A send Topic up / 1...] up / 10000 10000 topics content to 1, set retain retention message, send the second time, restart the Broker B, and then continue to send the latest Topic up / 1...] up / 1000010000 topics, content for 2 set retain retention message
Client C immediately reconnects after C received the data part is the latest content part 2 is the old data 1
The data received by Broker A after opening a client link is up-to-date
The problem may be that after the client below Broker B and Broker B subscribes to Topic up / #, when Broker sends it to the client, Broker receives the latest data, but Broker has not completed yet. He thinks the newly received data has been sent this time, so the client does not receive the latest data
My original requirement was to have a 4-level Broker, which was A1-> B1-> C1-> D1 respectively
Each Broker has a client link to the upper level, sending the data of the Broker to the upper level
But later I found that after you may restart the B1 in the middle, the subject part of the client subscription under B1 can not receive the latest data of the retain message, it is the old data,
Here is an example of my test
ConsoleApp51.zip
The text was updated successfully, but these errors were encountered: