I'm using Java Paho MQTT client in my application and I have set the maximum inflight messages to 15 and I'm publishing messages using qos 1.
The problem that I'm having is that sometimes the broker is dropping the messages and therefore is not sending an acknowledgement to the client, which keeps the dropped message in the inflight queue and will keep it forever since it will not be able to get the acknowledgement from the broker.
When I reach 15 messages in this situation, my client stops publishing because it is waiting for the acknowledgement that it will never receive.
Is there a way to set a expiration time to the inflight messages so my client does not hang in this situation?