Due to the batching, there is a situation where messages reside inside the converter.
The MQTT protocol does not allow for end 2 end acknowledgments, meaning that once the messages arrive at the converter, they are considered as “delivered”. Therefore, if the converter fails, the messages that were not yet uploaded into the S3 object are going to be lost.
To make sure that delivery is guaranteed, we would need a mechanism that makes sure that the messages are not lost if the converter crashes while waiting for a batch to fill.
One option fo that would be to write every message to persistent media (e.g. disk) as it arrives. If a process restarts, it would read that file and send the data in it.
However, this would have 2 main drawbacks:
- there will be a significant performance cost
- since mesages are automatically acked when received, everything in th disk buffer or that was not written yet will be lost on crash