emqttdThere are two ways in existence:
1.Through HTTP API (/api/clients), you can get all users who are currently online.
2.Subscribe to system themes
Receive incoming and offline notification separately.
The first way I think about it is to get all the online users at regular intervals through a timed task, and then compare the updates to redis
The second way is normal receipt notification update.
But now there are two problems.
The first method is not really real-time acquisition of data, will produce delays, and the large amount of data processing process time is not short;
Although the second method looks very flexible, but because the refresh of the web side will trigger the user’s offline and offline, so the server receives messages very high frequency, and can not rule out false offline;
Is there any expert who knows how to deal with this problem?
Can I add QQ to my landlord? I’m also using EMQ to do web push to ask you questions.