How to get client connection status on MQTT?

Hi all,
Is it possible to get client connection status on MQTT in server side to update client status?
When any new client is connect I want status of that client.

Hi @najabhaider96

it’s wonderful to have someone like you who’s enthusiastic about MQTT and the HiveMQ broker. Welcome to the HiveMQ Community! We’re excited to see new users like you.

According to the MQTT specification, to notify about its connection status, the MQTT client should publish a status message to the status topic you choose, for example, client1234 can publish to the topic “client1234/connectionStatus” a (retained) message “online”, client2480 can publish to the topic “client2480/connectionStatus” and so on. A backend client just has to subscribe to “+/connectionStatus” and it will receive all client connection messages.

Additionally, enterprise-grade HiveMQ broker provides Broker REST API that allows querying the broker regarding a client’s connection: HiveMQ 4.17.0 REST API documentation. Find out which HiveMQ offerings support this feature at the comparison page.

I hope this helped.

Best regards,
Dasha from HiveMQ Team