I am building a frontend application that should consume events from the solace queue via MQTT. So that when i get online after closing the app for a while, i should receive the events that are persisted in the queue, Possible to get the data? If mqtt is not possible, then let me know what other options.
Hi @Logesh ,
your requirement is:
- Use MQTT
- consume data from a queue after app is down for a while
?
This does not work with MQTT protocol.
In MQTT QoS1 (=Quality-of-Service 1… in Solace terms we name it “guaranteed messaging”), the subscription will be deleted after 60sec of downtime of app.
If your app re-connects after 45 sec, you see all messages arrived during the downtime.
If your app re-connects after 70sec, you don’t see messages arrived during the downtime.
I would recommend to use a different protocol for consuming, eg. all protocols from the Solace-protocol-family (for Java, Python, Go, c, ….) or AMQP if you’re in open protocols.
Hope that helps.
Uli
Thanks for the prompt reply.
The requirement is not to use MQTT, it is to use flutter, and connect to the queue to get messages even after reconnecting - as long as the event stays in the queue.
What would be the best practice to use with flutter that helps with scale.
@Logesh You can actually use MQTT to achieve your desired outcome:
- When you connect to Solace broker, set MQTT Clean Session to false
- Always use the same client ID to connect
- Use QoS1 subscription
With the above configuration, the session, client info, queue(auto generated) and data with matching subscription will be persistent in the broker. When the same client reconnect, it will be able to receive all data from the queue.
It worked! Thankyou so so much!