eclipse / mosquitto.rsmb

Mosquitto rsmb
85 stars 42 forks source link

Broker losses on second SUBSCRIBE #27

Open aignacio opened 8 years ago

aignacio commented 8 years ago

Hello all,

I'd note some strange behavior on my broker after send two SUBSCRIBE messages to the same topic id in sequence. I'm porting a lib. to MQTT-SN and for some reasons I don't acknowledge the first SUBACK message and when I send again to the broker, the broker send me the SUBACK again but when I see the publish messages the topic is something strange....

Must be:

/topic_1 TOPICO 1
/topic_2 TOPICO 2
/topic_3 TOPICO 3
/topic_4 TOPICO 4

What happens:

/topic_1 TOPICO 1
Engine.c TOPICO 2
/topic_3 TOPICO 3
/topic_4 TOPICO 4

Log of the broker

aaaa::c30c:0:0:2:1884 anderson <- MQTT-S SUBSCRIBE msgid: 1 qos: 0 topicIdType 1
 aaaa::c30c:0:0:2:1884 anderson -> MQTT-S SUBACK msgid: 1 topicid: 1 returncode: 0 (0)
 aaaa::c30c:0:0:2:1884 anderson -> MQTT-S PUBLISH msgid: 0 qos: 0 retained: 1 (0)
FIRST SUBACK LOST BY MY DEVICE:
 aaaa::c30c:0:0:2:1884 anderson <- MQTT-S SUBSCRIBE msgid: 2 qos: 0 topicIdType 1
 aaaa::c30c:0:0:2:1884 anderson -> MQTT-S SUBACK msgid: 2 topicid: 2 returncode: 0 (0)
 aaaa::c30c:0:0:2:1884 anderson -> MQTT-S PUBLISH msgid: 0 qos: 0 retained: 1 (0)
 aaaa::c30c:0:0:2:1884 anderson -> MQTT-S PINGRESP (0)
SECOND SUBACK ACKNOWLEDGE BY MY DEVICE:
 aaaa::c30c:0:0:2:1884 anderson <- MQTT-S SUBSCRIBE msgid: 2 qos: 0 topicIdType 1
 aaaa::c30c:0:0:2:1884 anderson -> MQTT-S SUBACK msgid: 2 topicid: 2 returncode: 0 (0)
 aaaa::c30c:0:0:2:1884 anderson <- MQTT-S SUBSCRIBE msgid: 3 qos: 0 topicIdType 1
 aaaa::c30c:0:0:2:1884 anderson -> MQTT-S SUBACK msgid: 3 topicid: 3 returncode: 0 (0)
 aaaa::c30c:0:0:2:1884 anderson -> MQTT-S PUBLISH msgid: 0 qos: 0 retained: 1 (0)
 aaaa::c30c:0:0:2:1884 anderson <- MQTT-S SUBSCRIBE msgid: 4 qos: 0 topicIdType 1
 aaaa::c30c:0:0:2:1884 anderson -> MQTT-S SUBACK msgid: 4 topicid: 4 returncode: 0 (0)

And in the topic that I send the second SUBSCRIBE the bug happens....