I want to simulate guaranteed delivery scenario where connection is unreliable (using mosquitto_pub and mosquitto_sub utilities). Connection can be unreliable on both producer as well as subscriber side.
Assume:
[Producer] --(1)--> [Broker] --(2)--> [Subscriber]
On subscriber side (segment #2 above), I am able to get reliable delivery using QoS > 0 and disabling clean session. Broker holds all messages if the subscriber disconnects and delivers them on next reconnect.
mosquitto_sub -h <brokerIP> -t testtopic -i testsubid -c -q 1
Question: How can I achieve the same on segment #1 (producer to broker)?
I want producer to keep "publishing" messages while network is unavailable, and want them delivered to broker once network is restored. Any way to do it out-of-the-box with mqtt library (storing messages on producer side)? In case if it helps, my final implementation will be in paho/python.
Thanks in advance.