I am building a MQTT based private messaging application using Eclipse Paho. I am a beginner in MQTT so need to understand implications of Topic architecture.
If user A has to send a message to user B:
- make user A subscribe to topic A and user B to topic B. So anyone messaging to B has to publish in topic B (the payload contains the sender details)
- make user A subscribe to A/# and B to B/#. So B messaging to A will publish to topic A/B
I want to know the recommended topic subscribing in private messaging considering implementation of other features like
- Last Seen
- Online
- Delivered
- Read
Please suggest ways (topic, pub and sub) to implement above features. For example after a client has connected to a broker, it will send a retained message to the topic A/status with the payload “online“.