I have succesfully configured a RabbitMQ cluster that supports MQTT via the MQTT plugin. At the moment, the MQTT messages pass a topic exchange whose binded with a work queue. So all MQTT messages are stored in this work queue.
Now I'd like to test the Input performance of this cluster by studying the graphs in the RabbitMQ management plugin. My plan was to set up 2 NodeJS MQTT publishers firing off many MQTT messages within a for loop but this fails.
When the for loop runs over 3000 times, not all messages survive... (Find my test code below) I'd like to have your opinion on this:
- What could be the reason messages don't survive?
- What is the best way to evaluate RabbitMQ/MQTT's performance?
- Should I use multiple publishers?
Code:
var quantity = 3000;
var mqtt = require('mqtt');
var options = {
host: 'localhost',
port: 1883,
protocolId: 'MQIsdp',
rejectUnauthorized: false,
protocolId: 'MQIsdp',
protocolVersion: 3
};
var client = mqtt.connect(options);
for(var x=0; x<quantity; x++)
{
client.publish('/WSN/N536,563E/dynamic',"22");
console.log(x);
}
client.end();