-
-
Notifications
You must be signed in to change notification settings - Fork 512
when client reconnect with cleansession:false,receivced last online message #128
Comments
Thanks for reporting! Are you using any specific database or broker? |
Mongodb |
Weird, confirmed. |
Released as 0.21.0! |
thx ,i'll test it again |
I am also getting the same issue.Also what I observed is that lets say when the client was offline then some 10 messages were send.Now when the application comes online then only the first offline message will be sent.And when we again restart the client then the next offline message will be send. Shouldn't the mosca server send all the offline message at once to client on reconnection? |
Can you please post some code to reproduce? |
I'm able to reproduce this issue as well on mosca 0.23 using the publish.js and subscriber.js given above. Steps to reproduce:
Interestingly, this issue is not present if I publish to the test mosca instance hosted at test.mosca.io. Mosca configuration var redis = {
type: 'redis',
redis: require('redis'),
db: 12,
port: 6379,
return_buffers: true, // to handle binary payloads
host: "localhost"
};
var moscaSettings = {
port: 1883,
stats: false,
backend: redis,
persistence: {
factory: mosca.persistence.Redis
}
}; The publisher var mqtt = require('mqtt');
var client = mqtt.createClient(1883, 'localhost',{encoding:'utf8', clientId: 'publish'});
client.on('connect', function(){
client.publish('/foo', "456", {qos:1, retain:false});
client.end();
}); The subscriber var mqtt = require('mqtt');
var client = mqtt.createClient(1883, 'localhost',{clean:false,encoding:'utf8', clientId: 'subscriber '});
client.on('connect', function(){
client.subscribe('/foo',{qos:1});
});
client.on('message', function(topic, msg){
console.log('Received Message:', topic, msg);
}); |
Confirmed on Redis. The instance on test.mosca.io is using LevelDB, which is not affected. |
This should be fixed in latest master. I would be grateful if you could give it a spin, otherwise I'll release it in the next few days as 0.23.2. |
I've given it a spin and the fix works. Thanks ! |
Released as 0.23.2. |
Not sure if this is the right Forum to post this issue, but anyways posting it to find some answers I have a strange issue with a Mosquitto bridge on my android device connecting to Mosca on cloud. The scenario is that I have a MQTT client connected to the Mosquitto bridge on the Android device and another client directly connected to the Mosca broker. When a message published through the mosca broker, the client directly connected to Mosca receives it only once [which is correct], but the client connected through the mosquitto bridge receives the same msg twice. The QOS is set to 1 at the bridge configuration and at the clients. The mosquitto bridge configuration is as below connection bridgetocloud We also noticed that when the android Mosquitto is bridged with a Mosquitto set up on one of our servers, the msg delivery behaves correctly with only only one msg recieved at the MQTT client. |
Bridge mode is not supported #25 |
mosca 0.20.3
mqtt 0.3.8
first run subscriber
subscriber.js
and run publish.js
the subscriber can receive message;
close the subscriber, run publish send offline message;
run subscriber second time, then subcriber can receive the offline message;
run publish send several online message.
close the subcriber again ,run publish send offline message,
this time when run subscriber to get offline message, it will receive the last all online message and offline message both.
when use Mosquitto 1.2.3 alone, havn't this issue
The text was updated successfully, but these errors were encountered: