Closed rokka-n closed 7 years ago
Mosquitto is written in C++. Mosca is written on top of Node.js. Mosquitto uses less resources, but Mosca can scale on multiple hosts.
I include Mosquitto in Mosca. But the pub/sub messaging still works fine even without adding Mosquitto. So what is the reason or benefit to use Mosquitto as a backend for Mosca? And how can I know that Mosca is using Mosquitto as a service?
My code is here:
var pubsubsettings = { type: 'mqtt', json: false, mqtt: require('mqtt'), host: '127.0.0.1', port: 1883 }; var moscaSettings = { port: 1884, //mosca (mqtt) port backend: pubsubsettings, //pubsubsettings is the object we created above }; var server = new mosca.Server(moscaSettings); server.on('ready', setup);
To know if you are using Mosquitto as a service, check if Mosquitto is receiving your messages. You do not need to do this to use Mosca.
Hi,
Are there any advantages of implementation for the broken in node? I'm pondering about performance and architectural differences between mosca and mosquitto.
Thanks!