I have multiple MQTT clients around the world. I'm hosting MQTT broker on dedicated server for these clients.
There is also one MQTT client app on same dedicated server that is hosting MQTT broker. This client receives messages from every other MQTT client and stores the data into database.
So MQTT clients every where are sending data every 10 seconds to there specified rooms and one MQTT client on dedicated server is listening all these rooms and gathering data.
Why this kind of syncing service is created with MQTT and not with web server and http post methods is beyond me.
Now client app on server is just processing every message in order as they came, but problem is that more there is outside clients sending data the bigger is list growing that is used as an buffer for arriving messages.
Processing data takes time as it is in json that has to be parsed before inserting into database.
Should I somehow create a new thread for each message to counter problem of growing buffer?
There is also one MQTT client app on same dedicated server that is hosting MQTT broker. This client receives messages from every other MQTT client and stores the data into database.
So MQTT clients every where are sending data every 10 seconds to there specified rooms and one MQTT client on dedicated server is listening all these rooms and gathering data.
Why this kind of syncing service is created with MQTT and not with web server and http post methods is beyond me.
Now client app on server is just processing every message in order as they came, but problem is that more there is outside clients sending data the bigger is list growing that is used as an buffer for arriving messages.
Processing data takes time as it is in json that has to be parsed before inserting into database.
Should I somehow create a new thread for each message to counter problem of growing buffer?