Closed ghost closed 6 years ago
messages are not stored. That's a capped collection used for synchronization between different instances.
Why do you want to store messages in different collections?
Thank you for your reply. I might mention wrong concept. Actually, my user case is that i want to create a system which has many users. Each user should have a collection to store all MQTT messages belonging to that user.
You should use the published event.
Can you help me to explain more ? Thank you so much.
You do server.on('published', func)
and func
is a function that stores the message in the user-specific collection.
Thank you so much. It is great recommendation. By the way you mentioned, as i understand, i will store the message in the user-specific collection without the need of using ascoltatore as backend. Is my right ? And i am wondering about performance bw using ascoltatore and without ascoltatore
Those things are separate. Ascoltatore is needed to do the inter-process communication. This is to store things for your application only,
Thank you for your help :)
As i know, mosca can use Mongo to store all messages through ascoltatore. To do that, we need to set configuration as follows:
With this setting, all messages are just stored at a mqtt collection of Mongo. So, my question is that how can i store messages on different collections more than one collection ?
Thank you so much.