I’m publishing messages (QoS=1, 1 message/second, 0.6 KB each) from a mobile client to a subscriber web app using MQTT. Each topic will have a single publisher.
For a topic, according to the MQTT specification, the broker should ensure the delivery of messages to subscribers in the order they were received.
- Is my understanding correct?
- How can I ensure in-order packet delivery from the mobile client to the broker? For example, should I wait for a PUBACK before sending the next message? While this would ensure in-order delivery, it might introduce latency based on PUBACK packet arrival time.
- When client is offline i want to queue all the unpublished messages, and then send it when client reconnects, do the HiveMQ Java client library have built in functionality to supports this, or we need to handle this at our own.
What’s the best approach to minimize latency while ensuring in-order and lossless delivery? Additionally, how can I achieve this using the HiveMQ Java client library?