How to test behavior with QoS 1 with connection drop-out mid-publish?
Hi there,
We are considering AWS IoT Core.
Our Quality department has asked for us to run a Operational Quality test between the MQTT client and AWS IoT MQTT broker so that we can document evidence of the following behavior:
- IF
- QoS 1 is enabled for publishing from a MQTT client to a MQTT broker's topic
- AND
- WHILE the MQTT client is publishing a message to that MQTT broker's topic
- IF the connection drops mid-publish
- THEN
- The MQTT broker will not accept the partial message -- and thus the message won't be delivered to the topic
- AND
- The MQTT client will NOT receive a PUBACK
I looked through the code and the only thing I could find that was close to this was https://github.com/eclipse/paho.mqtt.testing/blob/252b6b9a486336221a5fd9d7cd0560f70e7922d7/interoperability/client_test.py#L322 ...but that only tests if there is no connection to begin with.
In contrast, what I'm seeking is a way to demonstrate behavior:
- IF
- The connection was there to begin with
- AND THEN
- Mid-publish, the connection drops
Help?
One way to do this, is to use a network proxy between the client and broker which will break the connection at the appropriate point. There is such a simple proxy in the testing repo and the C client repo (paho.mqtt.c) written in Python. It can be altered to cut the connection at the point you want.
One way to do this, is to use a network proxy between the client and broker which will break the connection at the appropriate point. There is such a simple proxy in the testing repo and the C client repo (paho.mqtt.c) written in Python. It can be altered to cut the connection at the point you want.
Neat! I'll try it. Thank you!