YxAc commented on issue #116:
URL: https://github.com/apache/rocketmq-mqtt/issues/116#issuecomment-2134306333

   @pingww @ChangingFond @DongyuanPan @zongtanghu 
   
   Hi there, this feature has numerous applications in Xiaomi's production 
environment, such as electric vehicles and industrial IoT.
   
   I would like implement this feature using hooks. When a client comes online 
or goes offline, the MQTT server will generate an event and asynchronously push 
the event messages to the system topic in RocketMQ through hooks, enabling 
business subscribers to receive device client online/offline event messages.
   
   The implementation approach primarily involves defining events and hooks, 
event production, and event handling:
   ### Event and Hook Definition:
   - The `Event` includes specific information about client online and offline 
events, such as timestamp, clientId, clientIp, etc.
   - The `Hook`, which does not use chain calls (as it is unnecessary), mainly 
focuses on defining the interface.
   ### Event Production:
   - When the MQTT connection CONN is established.
   - When the MQTT connection is closed.
   ### Event Handling:
   - Implementing the `HookManager`, which handles event messages by pushing 
them to RocketMQ in a loop.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to