I need to check if the client is connected before sending the push message.

emqx-4.4.10

I need to check if the client is connected before sending the push message.

So I subscribed to a system topic to synchronize the information to Redis whenever a connect/disconnect event occurs.

  • $queue/$SYS/brokers/+/clients/+/#

However, there is a discrepancy between the number of clients actually connected to web admin and the number of clients registered in Redis.

emq web admin : about 270,000
redis : about 240,000

Is there any other way to check the exact connection status of the user before sending the message?

I checked the application logs.

It seems to be the same issue as the one below.

Does anyone have experience resolving this?

Does you subscriber online all the time?
maybe the messages are lost during the connect/reconnect.
does it reconnect with clean session = True?